[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YEoRzSw4xoEY6SPv@dhcp22.suse.cz>
Date: Thu, 11 Mar 2021 13:49:17 +0100
From: Michal Hocko <mhocko@...e.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Mike Kravetz <mike.kravetz@...cle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
"Paul E . McKenney" <paulmck@...nel.org>,
Shakeel Butt <shakeelb@...gle.com>, tglx@...utronix.de,
john.ogness@...utronix.de, urezki@...il.com, ast@...com,
Eric Dumazet <edumazet@...gle.com>,
Mina Almasry <almasrymina@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] hugetlb: select PREEMPT_COUNT if HUGETLB_PAGE for
in_atomic use
On Thu 11-03-21 12:36:51, Peter Zijlstra wrote:
[...]
> Also, Linus hates constructs like this:
>
> https://lkml.kernel.org/r/CAHk-=wht7kAeyR5xEW2ORj7m0hibVxZ3t+2ie8vNHLQfdbN2_g@mail.gmail.com
Btw. I would really appreciate if somebody would explain why it is
_fundamentally broken_ to check for an atomic context and chose a
different handling in a code path, like put_page, which is out of hands
of the called context? This can be called from a wide variety of
contexts. There is no way to pass a context information to the called
function. I do recognize that this is not an act of beauty but why
fundamentally broken?
The put_page context can certainly work towards robustness and operate
on the most restrictive context grounds (I really hope nobody will ever
come up with an idea that put_page can be called from nmi context). This
can make the code more complex and less optimal in normal case (e.g.
hugetlb is almost never freed from an atomic context - one has to be
really creative to achieve that). So where do we draw a line?
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists