[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150528065957.GJ17625@uranus.sw.swsoft.com>
Date: Thu, 28 May 2015 09:59:57 +0300
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
jarod@...hat.com, jstancek@...hat.com
Subject: Re: [PATCH 2/2] proc: fix PAGE_SIZE limit of /proc/$PID/cmdline
On Thu, May 28, 2015 at 02:12:07AM +0300, Alexey Dobriyan wrote:
> > > >
> > > > Could you please explain why this down/up is needed?
> > >
> > > Code is written this way to get constistent snapshot of data.
> >
> > it does not. you fetch data into local variables which is the
> > same as simply read them locklessly in general (because later
> > you refer to local vars).
>
> It is snapshot w.r.t getting both pairs not snapshot w.r.t atomicity or
> something (unsigned long access is atomic after all). Once down_write()
> is used in the other place, it even becomes obviously correct code!
Not at all. It is correct if and only if you're operating under lock
taken, once you fetch the pair and left the lock it simply local copies
of values the descriptor had when lock was taken.
Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists