[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJLuoQ=R3k_Fz7ZFdhrcsvhH5WxDKbLLhEN-jkzpzz6+w@mail.gmail.com>
Date: Sun, 26 Jan 2020 11:03:34 -0800
From: Eric Dumazet <edumazet@...gle.com>
To: Pavel Machek <pavel@...x.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>, stable@...r.kernel.org,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 599/639] net: avoid possible false sharing in sk_leave_memory_pressure()
On Sun, Jan 26, 2020 at 9:15 AM Pavel Machek <pavel@...x.de> wrote:
>
> On Fri 2020-01-24 10:32:49, Greg Kroah-Hartman wrote:
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > [ Upstream commit 503978aca46124cd714703e180b9c8292ba50ba7 ]
> >
> > As mentioned in https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance
> > a C compiler can legally transform :
> >
> > if (memory_pressure && *memory_pressure)
> > *memory_pressure = 0;
> >
> > to :
> >
> > if (memory_pressure)
> > *memory_pressure = 0;
>
> Well, C compiler can do a lot of stuff, and we rely on C compiler
> being "sane" -- that is gcc.
>
> Even if compiler did the transformation, that will only result in
> slightly slower performance, right?
>
> Is there any evidence this is problem in practice? Should this be in
> stable?
There is evidence of this problem in practice yes.
Should it be in stable I do not know.
Should stable kernels only be compiled by old compilers, I do not know.
Powered by blists - more mailing lists