Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754014AbbBTI4a (ORCPT ); Fri, 20 Feb 2015 03:56:30 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:60756 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752871AbbBTI43 (ORCPT ); Fri, 20 Feb 2015 03:56:29 -0500 Date: Fri, 20 Feb 2015 09:56:21 +0100 From: Peter Zijlstra To: Fabian Frederick Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Greg Kroah-Hartman Subject: Re: [RFC 1/1 linux-next] DRIVERS: replace current->state by set_current_state() Message-ID: <20150220085621.GL21418@twins.programming.kicks-ass.net> References: <1424377311-13144-1-git-send-email-fabf@skynet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424377311-13144-1-git-send-email-fabf@skynet.be> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1038 Lines: 24 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. -- 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/