Re: 'BUG: scheduling while atomic' during dccp transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/7/07, Florian Westphal <fw@xxxxxxxxx> wrote:
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.

Can you try with the attached patch?

- Arnaldo
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 248d20f..fb5710e 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -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;

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux