From: Michal Hocko <mhocko@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
David Rientjes <rientjes@google.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 1/9] sched: add schedule_timeout_idle()
Date: Tue, 22 Mar 2016 14:08:23 +0100 [thread overview]
Message-ID: <20160322130822.GF10381@dhcp22.suse.cz> (raw)
In-Reply-To: <20160322125113.GO6344@twins.programming.kicks-ass.net>
On Tue 22-03-16 13:51:13, Peter Zijlstra wrote:
> On Tue, Mar 22, 2016 at 01:33:14PM +0100, Michal Hocko wrote:
> > 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).
>
> Well, that's what you get; if you call schedule() and forget to set a
> blocking state you also don't block, where the problem?
The error prone nature of schedule_timeout usage was the reason to
introduce them in the first place IIRC which makes me think this is
something that is not so uncommon.
[...]
> > > 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.
>
> Dunno, changing them around isn't much work, we've got coccinelle for
> that.
If that sounds like a more appropriate plan I won't object. I can simply
change my patch to do __set_current_state and schedule_timeout.
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
David Rientjes <rientjes@google.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 1/9] sched: add schedule_timeout_idle()
Date: Tue, 22 Mar 2016 14:08:23 +0100 [thread overview]
Message-ID: <20160322130822.GF10381@dhcp22.suse.cz> (raw)
In-Reply-To: <20160322125113.GO6344@twins.programming.kicks-ass.net>
On Tue 22-03-16 13:51:13, Peter Zijlstra wrote:
> On Tue, Mar 22, 2016 at 01:33:14PM +0100, Michal Hocko wrote:
> > 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).
>
> Well, that's what you get; if you call schedule() and forget to set a
> blocking state you also don't block, where the problem?
The error prone nature of schedule_timeout usage was the reason to
introduce them in the first place IIRC which makes me think this is
something that is not so uncommon.
[...]
> > > 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.
>
> Dunno, changing them around isn't much work, we've got coccinelle for
> that.
If that sounds like a more appropriate plan I won't object. I can simply
change my patch to do __set_current_state and schedule_timeout.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2016-03-22 13:08 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 11:00 [PATCH 0/9] oom reaper v6 Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 1/9] sched: add schedule_timeout_idle() Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 12:23 ` Peter Zijlstra
2016-03-22 12:23 ` Peter Zijlstra
2016-03-22 12:33 ` Michal Hocko
2016-03-22 12:33 ` Michal Hocko
2016-03-22 12:51 ` Peter Zijlstra
2016-03-22 12:51 ` Peter Zijlstra
2016-03-22 13:08 ` Michal Hocko [this message]
2016-03-22 13:08 ` Michal Hocko
2016-03-22 13:22 ` Peter Zijlstra
2016-03-22 13:22 ` Peter Zijlstra
2016-03-22 17:56 ` Johannes Weiner
2016-03-22 17:56 ` Johannes Weiner
2016-03-22 21:23 ` Peter Zijlstra
2016-03-22 21:23 ` Peter Zijlstra
2016-03-23 10:43 ` Michal Hocko
2016-03-23 10:43 ` Michal Hocko
2016-03-22 23:02 ` Andrew Morton
2016-03-22 23:02 ` Andrew Morton
2016-03-22 11:00 ` [PATCH 2/9] mm, oom: introduce oom reaper Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 22:45 ` Andrew Morton
2016-03-22 22:45 ` Andrew Morton
2016-03-22 22:58 ` Hugh Dickins
2016-03-22 22:58 ` Hugh Dickins
2016-03-22 11:00 ` [PATCH 3/9] oom: clear TIF_MEMDIE after oom_reaper managed to unmap the address space Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 4/9] mm, oom_reaper: report success/failure Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 5/9] mm, oom_reaper: implement OOM victims queuing Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 6/9] oom, oom_reaper: disable oom_reaper for oom_kill_allocating_task Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 7/9] oom: make oom_reaper_list single linked Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 8/9] oom: make oom_reaper freezable Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 11:00 ` [PATCH 9/9] oom, oom_reaper: protect oom_reaper_list using simpler way Michal Hocko
2016-03-22 11:00 ` Michal Hocko
2016-03-22 22:08 ` [PATCH 0/9] oom reaper v6 David Rientjes
2016-03-22 22:08 ` David Rientjes
2016-03-23 11:11 ` Tetsuo Handa
2016-03-23 11:11 ` Tetsuo Handa
2016-03-23 12:07 ` Michal Hocko
2016-03-23 12:07 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160322130822.GF10381@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=peterz@infradead.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.