Skip to contentSkip to conversation

'BUG: scheduling while atomic' during dccp transfer

DISCUSSION Florian Westphal 2 participants 5 messages Jun 7, 2007 Networking

lore
Share & tools
lore
#0 lore raw

While transmitting data via dccp (Linux 2.6.21) I encountered this:

BUG: scheduling while atomic: firefox-bin/0x10000100/6792
 [<c02f8f4c>] schedule+0x43c/0x5c0
 [<c029c3af>] skb_checksum+0x4f/0x2a0
 [<c013818a>] handle_level_irq+0x7a/0xc0
 [<c01145d6>] __cond_resched+0x16/0x40
 [<c02f914a>] cond_resched+0x2a/0x40
 [<c0151d8a>] __kmalloc+0x6a/0x80
 [<d079e0ca>] ccid2_hc_tx_alloc_seq+0x4a/0xd0 [dccp_ccid2]
 [<d079e67c>] ccid2_hc_tx_packet_sent+0x13c/0x170 [dccp_ccid2]
 [<d079e540>] ccid2_hc_tx_packet_sent+0x0/0x170 [dccp_ccid2]
 [<d07ab917>] dccp_write_xmit+0x207/0x300 [dccp]
 [<d07ad667>] dccp_write_xmit_timer+0x37/0x40 [dccp]
 [<c011e843>] run_timer_softirq+0x123/0x180
 [<d07ad630>] dccp_write_xmit_timer+0x0/0x40 [dccp]
 [<d07ad630>] dccp_write_xmit_timer+0x0/0x40 [dccp]
 [<c011b522>] __do_softirq+0x42/0x90
 [<c011b596>] do_softirq+0x26/0x30
 [<c011b85a>] irq_exit+0x5a/0x60
 [<c0105ced>] do_IRQ+0x3d/0x70
 [<c011b228>] sys_gettimeofday+0x28/0x80
 [<c01040db>] common_interrupt+0x23/0x28
 [<c02f0000>] km_policy_expired+0x10/0x50
 ===========

Please CC me on replies, i'm not subscribed.
Thanks, Florian.

#1 lore raw
Quoted 26 lines · Florian Westphal

While transmitting data via dccp (Linux 2.6.21) I encountered this:

BUG: scheduling while atomic: firefox-bin/0x10000100/6792
 [<c02f8f4c>] schedule+0x43c/0x5c0
 [<c029c3af>] skb_checksum+0x4f/0x2a0
 [<c013818a>] handle_level_irq+0x7a/0xc0
 [<c01145d6>] __cond_resched+0x16/0x40
 [<c02f914a>] cond_resched+0x2a/0x40
 [<c0151d8a>] __kmalloc+0x6a/0x80
 [<d079e0ca>] ccid2_hc_tx_alloc_seq+0x4a/0xd0 [dccp_ccid2]
 [<d079e67c>] ccid2_hc_tx_packet_sent+0x13c/0x170 [dccp_ccid2]
 [<d079e540>] ccid2_hc_tx_packet_sent+0x0/0x170 [dccp_ccid2]
 [<d07ab917>] dccp_write_xmit+0x207/0x300 [dccp]
 [<d07ad667>] dccp_write_xmit_timer+0x37/0x40 [dccp]
 [<c011e843>] run_timer_softirq+0x123/0x180
 [<d07ad630>] dccp_write_xmit_timer+0x0/0x40 [dccp]
 [<d07ad630>] dccp_write_xmit_timer+0x0/0x40 [dccp]
 [<c011b522>] __do_softirq+0x42/0x90
 [<c011b596>] do_softirq+0x26/0x30
 [<c011b85a>] irq_exit+0x5a/0x60
 [<c0105ced>] do_IRQ+0x3d/0x70
 [<c011b228>] sys_gettimeofday+0x28/0x80
 [<c01040db>] common_interrupt+0x23/0x28
 [<c02f0000>] km_policy_expired+0x10/0x50
 =======================
Quoted 2 lines

Please CC me on replies, i'm not subscribed.
Thanks, Florian.

Can you try with the attached patch?

- Arnaldo

net/dccp/ccids/ccid2.c +4 -5
index 248d20f..fb5710e 100644
@@ -83,8 +83,7 @@ static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx)
 #define ccid2_hc_tx_check_sanity(hctx)
 #endif
 
-static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num,
-				 gfp_t gfp)
+static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num)
 {
 	struct ccid2_seq *seqp;
 	int i;
@@ -95,7 +94,7 @@ static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num,
 		return -ENOMEM;
 
 	/* allocate buffer and initialize linked list */
-	seqp = kmalloc(sizeof(*seqp) * num, gfp);
+	seqp = kmalloc(sizeof(*seqp) * num, GFP_ATOMIC);
 	if (seqp == NULL)
 		return -ENOMEM;
 
@@ -298,7 +297,7 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, int more, unsigned int len)
 		int rc;
 
 		ccid2_pr_debug("allocating more space in history\n");
-		rc = ccid2_hc_tx_alloc_seq(hctx, CCID2_SEQBUF_LEN, GFP_KERNEL);
+		rc = ccid2_hc_tx_alloc_seq(hctx, CCID2_SEQBUF_LEN);
 		BUG_ON(rc); /* XXX what do we do? */
 
 		next = hctx->ccid2hctx_seqh->ccid2s_next;
@@ -771,7 +770,7 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
 	hctx->ccid2hctx_seqbufc   = 0;
 
 	/* XXX init ~ to window size... */
-	if (ccid2_hc_tx_alloc_seq(hctx, CCID2_SEQBUF_LEN, GFP_ATOMIC) != 0)
+	if (ccid2_hc_tx_alloc_seq(hctx, CCID2_SEQBUF_LEN) != 0)
 		return -ENOMEM;
 
 	hctx->ccid2hctx_sent	 = 0;
#2 lore raw
In reply to Florian Westphal
Quoted 3 lines · Arnaldo Carvalho de Melo
Quoted 3 lines

While transmitting data via dccp (Linux 2.6.21) I encountered this:

BUG: scheduling while atomic: firefox-bin/0x10000100/6792

[..]

Quoted 1 line

Can you try with the attached patch?

I haven't been able to reproduce it so far.

Thanks!

Florian

#3 lore raw
In reply to Florian Westphal
Quoted 9 lines · Florian Westphal
Quoted 3 lines · Arnaldo Carvalho de Melo
Quoted 3 lines

While transmitting data via dccp (Linux 2.6.21) I encountered this:

BUG: scheduling while atomic: firefox-bin/0x10000100/6792

[..]

Quoted 1 line

Can you try with the attached patch?

I haven't been able to reproduce it so far.

You mean with this patch applied?

- Arnaldo

#4 lore raw
In reply to Florian Westphal
Quoted 6 lines · Arnaldo Carvalho de Melo
Quoted 3 lines · Florian Westphal
Quoted 1 line

Can you try with the attached patch?

I haven't been able to reproduce it so far.

You mean with this patch applied?

Yes, sorry for not being precise. I applied your
patch and so far I haven't seen this bug again.

Thanks,
Florian