Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Mar 2004 21:34:49 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i2U5YjKO011893 for ; Mon, 29 Mar 2004 21:34:45 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i2U5XqFV673152; Tue, 30 Mar 2004 00:33:52 -0500 Received: from snowy.in.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i2U5Y75X106546; Tue, 30 Mar 2004 00:34:10 -0500 Received: by snowy.in.ibm.com (Postfix, from userid 500) id 1984624A41; Tue, 30 Mar 2004 11:05:15 +0530 (IST) Date: Tue, 30 Mar 2004 11:05:15 +0530 From: Srivatsa Vaddagiri To: Andrea Arcangeli Cc: Dipankar Sarma , linux-kernel@vger.kernel.org, netdev@oss.sgi.com, Robert Olsson , "Paul E. McKenney" , Dave Miller , Alexey Kuznetsov , Andrew Morton , rusty@au1.ibm.com Subject: Re: route cache DoS testing and softirqs Message-ID: <20040330053515.GA4815@in.ibm.com> Reply-To: vatsa@in.ibm.com References: <20040329184550.GA4540@in.ibm.com> <20040329222926.GF3808@dualathlon.random> <20040330050614.GA4669@in.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040330050614.GA4669@in.ibm.com> User-Agent: Mutt/1.4.1i X-archive-position: 4340 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vatsa@in.ibm.com Precedence: bulk X-list: netdev Content-Length: 1196 Lines: 44 On Tue, Mar 30, 2004 at 10:36:14AM +0530, Srivatsa Vaddagiri wrote: > kthread_stop does: > > 1. kthread_stop_info.k = k; > 2. wake_up_process(k); > > and if ksoftirqd were to do : > > a. while (!kthread_should_stop()) { > b. __set_current_state(TASK_INTERRUPTIBLE); > c. schedule(); > } > > > There is a (narrow) possibility here that a) happens _after_ 1) as well as > b) _after_ 2). hmm .. I meant a) happening _before_ 1) and b) happening _after_ 2) .. > > a. __set_current_state(TASK_INTERRUPTIBLE); > b. while (!kthread_should_stop()) { > c. schedule(); > d. __set_current_state(TASK_INTERRUPTIBLE); > } > > e. __set_current_state(TASK_RUNNING); > > In this case, even if b) happens _after_ 1) and c) _after_ 2), Again I meant "even if b) happens _before_ 1) and c) _after_ 2) !! > schedule simply returns immediately because task's state would have been set > to TASK_RUNNING by 2). It goes back to the kthread_should_stop() check and > exits! -- Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560017