From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:59564 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726979AbeLELZn (ORCPT ); Wed, 5 Dec 2018 06:25:43 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 05 Dec 2018 12:25:39 +0100 From: Roman Penyaev To: Andrea Parri Cc: Linus Torvalds , Al Viro , Paul McKenney , linux-fsdevel , Linux List Kernel Mailing Subject: Re: [RFC PATCH 1/1] epoll: use rwlock in order to reduce ep_poll_callback() contention In-Reply-To: <20181204235907.GA5388@andrea> References: <20181203110237.14787-1-rpenyaev@suse.de> <83edf06ce9db540495b53527eca3248c@suse.de> <20181204235907.GA5388@andrea> Message-ID: <51e8202b163d7522efb18aa2ca79d952@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 2018-12-05 00:59, Andrea Parri wrote: > Hi Roman, > > On Tue, Dec 04, 2018 at 12:50:58PM +0100, Roman Penyaev wrote: >> On 2018-12-03 18:34, Linus Torvalds wrote: > >> > This also ends up making the memory ordering of "xchg()" very very >> > important. Yes, we've documented it as being an ordering op, but I'm >> > not sure we've relied on it this directly before. >> >> Seems exit_mm() does exactly the same, the following chunk: >> >> up_read(&mm->mmap_sem); >> >> self.task = current; >> self.next = xchg(&core_state->dumper.next, &self); >> >> >> At least code pattern looks similar. > > Maybe add a comment on top of (your) xchg() to note/justify these > memory > ordering requirements? As Paul said: "if there are races, this would > help force them to happen" (and simplify the review, this/future). Hi Andrea, Sure, this path is tricky, so will I cook something up. -- Roman