From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 28 Mar 2019 17:26:42 +0100 From: Oleg Nesterov Subject: Re: [PATCH] Convert struct pid count to refcount_t Message-ID: <20190328162641.GC19441@redhat.com> References: <20190327145331.215360-1-joel@joelfernandes.org> <20190328023432.GA93275@google.com> <20190328143738.GA261521@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Jann Horn Cc: Joel Fernandes , "Paul E. McKenney" , Kees Cook , "Eric W. Biederman" , LKML , Android Kernel Team , Kernel Hardening , Andrew Morton , Matthew Wilcox , Michal Hocko , "Reshetova, Elena" List-ID: On 03/28, Jann Horn wrote: > > Since we're just talking about RCU stuff now, adding Paul McKenney to > the thread. Since you added Paul let me add more confusion to this thread ;) There were some concerns about the lack of barriers in put_pid(), but I can't find that old discussion and I forgot the result of that discussion... Paul, could you confirm that this code CPU_0 CPU_1 X = 1; if (READ_ONCE(Y)) mb(); X = 2; Y = 1; BUG_ON(X != 2); is correct? I think it is, control dependency pairs with mb(), right? If not, then put_pid() needs atomic_read_acquire() as it was proposed in that discussion. Oleg.