Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8869492imu; Tue, 4 Dec 2018 16:00:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/U86FMsLEblwDW0YNa5Cul/opKtj0z60tUC6MatDnbIyTz8TiGTTo/pRjnU5nSjjlCCd/ai X-Received: by 2002:a62:b9a:: with SMTP id 26mr22439976pfl.196.1543968005903; Tue, 04 Dec 2018 16:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543968005; cv=none; d=google.com; s=arc-20160816; b=WPGEH88uH5n+Df8f6QS+J2CVSrMw4nbPjhTyFYjKOwkVLHLcDwW09hKSmEbIGqSsB5 wRwbFw5m1FW6Bkmm0TZXlaZ69x1hQpnqBdbZePnR2idA6OgSOWJ/GSq8ycw/5qHbIj/9 Tzl264Rz9CH48iHiVMYKsOjdJ/J9NEn8vqnPgdgZiWeXeNPpVUG4UDlujFHGVVscXEoZ aGIL+TMxrORjAjW4/jJG+RaEfXkaMI2oUk0t50a/mexnn62V3YOk3fRCkV6C4GaTdhZf FRxGEk9LZ9NcQS9RLcQ2hqldyjFot4VYkn56l4LCBOYOgae64w41ptSXh6xgpk55dqfh xC7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SqoyHVYj/uLGolRV4jdUgg7Lv7ReizNW/bp9vefhxxE=; b=jXy9FGhTj8nbEPZDz69X8CC3FPqgLQeAbLlFVIPuktaiv5nOaivb9mpUJ2xpKdMCmc RYfuVVmJUE9Q19HW2XoR24nO5tWBneM6q+jublfkHMopM2Fhb2G2P/g0lOg/GrB46F5B pOHnAFKwW9Bx5EjgGb+nzqoNark8vaEsXGMj3Ulym81YBxeREzHTpX1d5VS42w8PyieQ NwSuQ/QmK5dFoi3Y3rSRRrSWBuwKENE5L82sxedQsfmikNvkaz/Q1/gWHftYSI2pHw5b ALYHHw92jXH0g1p6v5BV0ji+AiMuLrREWbQL603hSfawV3YXO/noNuCdkJs1hfRLMvVG RQsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CDqo1FKu; 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 v8si18606616ply.126.2018.12.04.15.59.50; Tue, 04 Dec 2018 16:00:05 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CDqo1FKu; 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 S1725886AbeLDX7Q (ORCPT + 99 others); Tue, 4 Dec 2018 18:59:16 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42670 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbeLDX7Q (ORCPT ); Tue, 4 Dec 2018 18:59:16 -0500 Received: by mail-ed1-f66.google.com with SMTP id j6so15465036edp.9 for ; Tue, 04 Dec 2018 15:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SqoyHVYj/uLGolRV4jdUgg7Lv7ReizNW/bp9vefhxxE=; b=CDqo1FKulmo9s37ik+eLl5nIpbW0DcWIFENtjvirsB7VnxedkR66kkJSQBkl4/dRjQ uOuOjdiQFznTwhpMgBjEr6WKcqHREnDi62MXbEeGqsLIDg7wjM8v/UjD6CKZwKWrBg0N jHI0NtCUR7NFyVU+lexd4bWte6N3NH2h4xPh8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SqoyHVYj/uLGolRV4jdUgg7Lv7ReizNW/bp9vefhxxE=; b=lxSRPKRd6hoQdJQwGu1toiUUXB7VntjKOfY6WSYJymloNWemha3FSi0WnSellk0uW6 CGj/JJKncpryKitx5q7hHLjrz0dvkgKIUhwsV2EOwntg77QAtrWGvUggjY8GPxaRwYg9 PKBgw1QcAYUDy5wlCJxeCmdo0njw06O92w7RXRx+VvynfvYQ0pMpUx3KH4C8x/8t2VE2 nvmtz9Triw6iFE3qt/fnjEhyyjPRRYIRDOtQHsinZWu3WGzspKhEX1sEQsIFlNouRehe vD1M5Alu0h50wX3gvP3uljS6AmpABU1FrbaU12SzMxQRWwZZFOmzBMsTJ/zEWnfec3T8 7wmQ== X-Gm-Message-State: AA+aEWYvGlsq/EeuWzUWnwO6IqShCRyAAS+R1fYWxonb85DdHrb4DZpt WSOIebo+DDdpl/aXjwq/7AHWpqBnZWvXtA== X-Received: by 2002:a17:906:6b99:: with SMTP id l25-v6mr16717548ejr.154.1543967954635; Tue, 04 Dec 2018 15:59:14 -0800 (PST) Received: from andrea (dynamic-2a00-1028-8386-da8a-eacb-c188-78b9-634c.ipv6.broadband.iol.cz. [2a00:1028:8386:da8a:eacb:c188:78b9:634c]) by smtp.gmail.com with ESMTPSA id x10sm4933356edb.58.2018.12.04.15.59.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Dec 2018 15:59:13 -0800 (PST) Date: Wed, 5 Dec 2018 00:59:07 +0100 From: Andrea Parri To: Roman Penyaev 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 Message-ID: <20181204235907.GA5388@andrea> References: <20181203110237.14787-1-rpenyaev@suse.de> <83edf06ce9db540495b53527eca3248c@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83edf06ce9db540495b53527eca3248c@suse.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Andrea