From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758234Ab3FMCLX (ORCPT ); Wed, 12 Jun 2013 22:11:23 -0400 Received: from intranet.asianux.com ([58.214.24.6]:34351 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756400Ab3FMCLW (ORCPT ); Wed, 12 Jun 2013 22:11:22 -0400 X-Spam-Score: -100.8 Message-ID: <51B92A19.9090700@asianux.com> Date: Thu, 13 Jun 2013 10:10:33 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Thomas Gleixner CC: Frederic Weisbecker , Sedat Dilek , Paul McKenney , Andrew Morton , Linus Torvalds , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] kernel/softirq.c: delete 'while' looping to improve a little performance and beautify code References: <51B4755B.4020205@asianux.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/2013 10:15 PM, Thomas Gleixner wrote: > On Sun, 9 Jun 2013, Chen Gang wrote: >> > After finish the internal 'while', need not test TASKLET_STATE_SCHED >> > again, so looping back to outside 'while' is only for set_bit(). >> > >> > When use 'if' and set_bit() instead of 'while', it will save at least >> > one running conditional instruction, and also will be clearer for readers >> > (although the binary size will be a little bigger). > And by doing that you break the atomicity of test_and_set_bit. There > is a good reason why this is an atomic operation and why the code is > written as is. > OK, thanks. it is my fault (and also sorry for replying late). >> > The related patch is "1da177e Linux-2.6.12-rc2" > How is that patch related to the problem? Because the modification since Linux-2.6.12-rc2. Thanks. -- Chen Gang Asianux Corporation