Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9350822imu; Wed, 5 Dec 2018 03:26:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpvMZlZ/kxxVQ8L5xhAlrfzGMuUcx6cyWkB7zfLaya6csjFA+OSG7hnXn7o+YpvlUsEwys X-Received: by 2002:a63:89c2:: with SMTP id v185mr18536099pgd.97.1544009197097; Wed, 05 Dec 2018 03:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544009197; cv=none; d=google.com; s=arc-20160816; b=rDrfqX0rFIpsRel082Vu4wSh4d7nktYrSIUePl50S+d8bJDZRUIjekHrwNqhlQgSP9 2p6uL0E6PmgmlzytHNZ1ivcfPx+O1lbo3kOIBC8MtQWOh2RBdFDHY5C9Tbtbh1qI0RgV 4TOLpl/i8Qx1jz8WgC5z1FVXPfIXqCxNJIZ7K/hktshuYR9TzBhg33eC+v+d+TMlF3bD RglQxWxaVjS48Y79SLgFFouCgHn/eKYyR+f2zhGv4BA1TTYYMBw6cy2g16aj/VVa95kD DLXcW9CjGror2aGlQ26AIRqfuTC5F9/lLhGzREhmEP6vVmELFAoUmHBKYV4FAT+1I+rT 1HvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=EsDw3N8o0TO81AYu97F4tOY/cJXLZev1eocX8b5VDwI=; b=GDklXc0Tt+xOxX20bIvuvY+5cSdKf1U6czbf7SLSuSYlvJckDj87H/mJ+PA7Co1dvU uk5q45k8OMtq0Z7MXwY7Wy1l4jjyefh5L2l4i6iGaGUEXaQ67tLvbSUPhYWnDkfVQE4J yhe6fOrw9plhAeOenFOCVDkdeymJvnDzReb4z0RpHFgjDU/pctOQkGiQrvXBFOMMtOa7 nZoeVR6HpnlJpLId3yKwSc5PXtCAdCP7/kBDlJiDPfwDA5yN73/duiU7WL8WgHhSWAoA ZWgD2WB1+YflubvHrBk8EJZlF4+pXcbuqY9S8uc8XuSGmzSsxvimXGOf5+37+7ve6zg5 Q1fQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u69si19415363pfj.219.2018.12.05.03.26.20; Wed, 05 Dec 2018 03:26:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbeLELZo (ORCPT + 99 others); Wed, 5 Dec 2018 06:25:44 -0500 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 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 036C1B002; Wed, 5 Dec 2018 11:25:41 +0000 (UTC) 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> X-Sender: rpenyaev@suse.de User-Agent: Roundcube Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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