From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by kanga.kvack.org (Postfix) with ESMTP id 58C996B007E for ; Tue, 22 Mar 2016 08:33:17 -0400 (EDT) Received: by mail-wm0-f45.google.com with SMTP id l68so190359503wml.0 for ; Tue, 22 Mar 2016 05:33:17 -0700 (PDT) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com. [74.125.82.67]) by mx.google.com with ESMTPS id 202si20108902wmy.77.2016.03.22.05.33.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 05:33:16 -0700 (PDT) Received: by mail-wm0-f67.google.com with SMTP id u125so3303037wmg.0 for ; Tue, 22 Mar 2016 05:33:16 -0700 (PDT) Date: Tue, 22 Mar 2016 13:33:14 +0100 From: Michal Hocko Subject: Re: [PATCH 1/9] sched: add schedule_timeout_idle() Message-ID: <20160322123314.GD10381@dhcp22.suse.cz> References: <1458644426-22973-1-git-send-email-mhocko@kernel.org> <1458644426-22973-2-git-send-email-mhocko@kernel.org> <20160322122345.GN6344@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160322122345.GN6344@twins.programming.kicks-ass.net> Sender: owner-linux-mm@kvack.org List-ID: To: Peter Zijlstra Cc: Andrew Morton , linux-mm@kvack.org, LKML , Tetsuo Handa , David Rientjes , Ingo Molnar On Tue 22-03-16 13:23:45, Peter Zijlstra wrote: > On Tue, Mar 22, 2016 at 12:00:18PM +0100, Michal Hocko wrote: > > > extern signed long schedule_timeout_interruptible(signed long timeout); > > extern signed long schedule_timeout_killable(signed long timeout); > > extern signed long schedule_timeout_uninterruptible(signed long timeout); > > +extern signed long schedule_timeout_idle(signed long timeout); > > > +/* > > + * Like schedule_timeout_uninterruptible(), except this task will not contribute > > + * to load average. > > + */ > > +signed long __sched schedule_timeout_idle(signed long timeout) > > +{ > > + __set_current_state(TASK_IDLE); > > + return schedule_timeout(timeout); > > +} > > +EXPORT_SYMBOL(schedule_timeout_idle); > > Yes we have 3 such other wrappers, but I've gotta ask: why? They seem > pretty pointless. It seems it is just too easy to miss the __set_current_state (I am talking from my own experience). This also seems to be a pretty common pattern so why not wrap it under a common call. > Why not kill the lot? We have over 400 users, would it be much better if we open code all of them? It doesn't sound like a huge win to me. -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org