Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932161AbbBTSR7 (ORCPT ); Fri, 20 Feb 2015 13:17:59 -0500 Received: from mailsec108.isp.belgacom.be ([195.238.20.104]:56694 "EHLO mailsec108.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753570AbbBTSR6 convert rfc822-to-8bit (ORCPT ); Fri, 20 Feb 2015 13:17:58 -0500 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=M25fSHNwW0AVyF8PBjdaZiLQS1FBtLFJFIDkHdlBKq0= c=1 sm=2 a=IkcTkHD0fZMA:10 a=JfrnYn6hAAAA:8 a=ls7_mgLtyB6i0xOE8esA:9 a=QEXdDO2ut3YA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BKBQAqeedU/9EU7sNbgwaENK0WBphDAoEZQwEBAQEBAXyEDwEBAQMBIwRSBQsFBhgCAhgOAgJXBhMRiBYMvD+GU5FmAQsBH4EhhGOFC4Q7MweCaIFDBZosgxWGPIhFIoNvPTGCQwEBAQ Date: Fri, 20 Feb 2015 19:17:56 +0100 (CET) From: Fabian Frederick Reply-To: Fabian Frederick To: Peter Zijlstra Cc: Ingo Molnar , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Message-ID: <1871487377.57679.1424456276724.open-xchange@webmail.nmp.proximus.be> In-Reply-To: <20150220085621.GL21418@twins.programming.kicks-ass.net> References: <1424377311-13144-1-git-send-email-fabf@skynet.be> <20150220085621.GL21418@twins.programming.kicks-ass.net> Subject: Re: [RFC 1/1 linux-next] DRIVERS: replace current->state by set_current_state() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.2.2-Rev27 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1313 Lines: 35 > On 20 February 2015 at 09:56 Peter Zijlstra wrote: > > > On Thu, Feb 19, 2015 at 09:21:51PM +0100, Fabian Frederick wrote: > > replace remaining direct access to current->state by slower > > helper function in drivers branch. > > Some of them could be optimized later using __set_current_state(). > > This changelog needs help. Going by this you just make the drivers worse > (slower). > > The reason for using set_current_state() is not that its slower, its > because its actually correct; as opposed to direct assignments which are > prone to races and therefore buggy. > > Also, since all were direct assignments you can immediately use > __set_current_state() for TASK_RUNNING; code will not be broken more by > that and relying on the barrier for TASK_RUNNING is obscure and rare > anyhow. > > So sure, the idea is good, but please, write a coherent changelog to go > with it. Thanks a lot for explanation Peter, I meant set_current_state was slower than __set_current_state. I hope changelog is ok in the patchset.   Regards, Fabian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/