Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4058515imm; Mon, 15 Oct 2018 08:28:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV62OI82NZqReqj8umjmqqdYau437mzSzcQn9Ypx67zqB+e8HiDNQyUKddXAf9OB2whe2cRxl X-Received: by 2002:a17:902:4383:: with SMTP id j3-v6mr13752320pld.265.1539617282808; Mon, 15 Oct 2018 08:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539617282; cv=none; d=google.com; s=arc-20160816; b=s9dkx7sLYGIzlQLY1qMibHoX93iO5tHdSYXaYO46/wQhk1UJHRXVkP2IX82ucqO51L Z2uysk6BPWBIOzE0iggECFp+MopZoEDjL9ez92xkglN9XTzl7L+fGm5tRYL9c5I9B6wg nyStQyPJQBQcSwJLXDROl+ZHS/00HLPgzEn9iRmYHdCV6JPbYwelJAwBEccIiuW5F9pJ NZ3yOTjwu5/kdBBI9TGCCGLan6CxllN8FARjj1j0TDXm+ZnhH0u9zXb5BfcSrucbi9Ch 6vRD804+B4v1kIoZcRZN0xdgHJAdg1IZDQqSlkn1sfE4Bnf9XtZLSI83VrpS6bVtIy62 UjNw== 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=k/sEKHv4VcnQHFk/MM1gVcgLibNiDzLfHDD/o3V9rBM=; b=pHIsz2kyPZ5uecDOiAyPgH9a12wFNMUEstG/FSKk4b1heHrhLWUhDnl/M8/cy5AJEy m5BXUH2Qq7ckmtT6dvI8IpcP1jWjC0WiNWk4y3MOZiW9BaenJWTnpZezOM69j/u/8f++ ovtREPrfvpDalyDsTsIXTylBm0gWm8e3ZHbO8ODiadUPXRcf82WaMo1sr2ZTm6GFLGoM MfvHpGYzmufSYXh1EFaxjaCfYL6UQtNchCDW/k290ETUsiHftQVyQfCAiTKoPG/Mm6up NwOfQWVGl7evqFB+w0z7Db1mnO84cPMWwitQ1Xj/36JHiiB2p6sMlFQiiz7NTJFJ0JTh 2HuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O36urTsk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si10849804plb.384.2018.10.15.08.27.47; Mon, 15 Oct 2018 08:28:02 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=O36urTsk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbeJOXM4 (ORCPT + 99 others); Mon, 15 Oct 2018 19:12:56 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:37053 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbeJOXM4 (ORCPT ); Mon, 15 Oct 2018 19:12:56 -0400 Received: by mail-qt1-f193.google.com with SMTP id d14-v6so21889772qto.4 for ; Mon, 15 Oct 2018 08:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k/sEKHv4VcnQHFk/MM1gVcgLibNiDzLfHDD/o3V9rBM=; b=O36urTskoOYlGdClPcSJLyazt3tBhECsjV9DA+VXyc5xT+Cp4mjHfU9ULVBuxD08nd ZzA27ENIQmdo9MwLmSrfHiGVdpsBYp5/ZUjFSmQmPYU13Yx7AyMkfKXLdVKclrNi/ugO g5RyAC7R1Pxo4QL+PGXQi6jtGbJLvx/ci6jvrQOyR00MxdwLAE5JbN6ieU/iduYw+k+r RiZfAjhpP+jwU8mamfV7I6AOweLB/Agez6X0ESK9euHaJej9KH9CktvPmoIeqrW+nRp7 yPFTB+syQeY5pebH4nWm//6fS4VpZB/iLtmLJxOqzfXXmKyL4YKrxTh7FxP/8l88l1Pj tiWA== 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=k/sEKHv4VcnQHFk/MM1gVcgLibNiDzLfHDD/o3V9rBM=; b=Y1nO7MJbiyRT5vG6R2OkDK0X7zFqM5krp4d+npal4/CTbDNg4iBe7nZfutG2MrHCLk aWb6t4w5PgLTkrDl9uN3IxFZN15x9p+i7qFEhJbdkEDwaXPVzacafnxODnK+z6JwUdAr WNqA0JhtObivgj96orju/lCQLPog4vjNgqH77cB5348hc9LWbfqZUw8qb7ZkyVLAUM+D V9BzqYqnEMO6ni3svFQuvH/NdJr42BLp/20Z86+tuv/nRQWb6xWLxtmaC1AvwxspddOa 7CBml/86kVOBIFGkAG0Ty/DBh+7rpyCVyLr1J7Gf7qXjSRmvreS6BsoowFpdzQX4nUPv V8PQ== X-Gm-Message-State: ABuFfojqsRQCB3Ozdd4lewaYaezMfNdXj82zclVF10x6++LLZhBqbnB0 rNgCXxB46JqrqaROfIz7gKg= X-Received: by 2002:a0c:81e4:: with SMTP id 33mr17694621qve.135.1539617231887; Mon, 15 Oct 2018 08:27:11 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id g39-v6sm7643690qtc.89.2018.10.15.08.27.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 08:27:11 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 8F43720B71; Mon, 15 Oct 2018 11:27:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 15 Oct 2018 11:27:10 -0400 X-ME-Sender: X-ME-Proxy: Received: from localhost (unknown [45.32.128.109]) by mail.messagingengine.com (Postfix) with ESMTPA id 14BB9E455F; Mon, 15 Oct 2018 11:27:09 -0400 (EDT) Date: Mon, 15 Oct 2018 23:33:48 +0800 From: Boqun Feng To: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" , Tejun Heo , linux-kernel@vger.kernel.org, Peter Zijlstra , "Aneesh Kumar K.V" , tglx@linutronix.de, Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan Subject: Re: [PATCH] rcu: Use cpus_read_lock() while looking at cpu_online_mask Message-ID: <20181015153348.GB8952@tardis> References: <20180911160532.GJ4225@linux.vnet.ibm.com> <20180911162142.cc3vgook2gctus4c@linutronix.de> <20180911170222.GO4225@linux.vnet.ibm.com> <20180919205521.GE902964@devbig004.ftw2.facebook.com> <20180919221140.GH4222@linux.ibm.com> <20181012184114.w332lnkc34evd4sm@linutronix.de> <20181013134813.GD2674@linux.ibm.com> <20181015144217.nu5cp5mxlboyjbre@linutronix.de> <20181015150715.GA2422@tardis> <20181015150902.asifwhikqkz53ai4@linutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yNb1oOkm5a9FJOVX" Content-Disposition: inline In-Reply-To: <20181015150902.asifwhikqkz53ai4@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 15, 2018 at 05:09:03PM +0200, Sebastian Andrzej Siewior wrote: > On 2018-10-15 23:07:15 [+0800], Boqun Feng wrote: > > Hi, Sebastian > Hi Boqun, >=20 > > On Mon, Oct 15, 2018 at 04:42:17PM +0200, Sebastian Andrzej Siewior wro= te: > > > On 2018-10-13 06:48:13 [-0700], Paul E. McKenney wrote: > > > >=20 > > > > My concern would be that it would queue it by default for the curre= nt > > > > CPU, which would serialize the processing, losing the concurrency of > > > > grace-period initialization. But that was a long time ago, and per= haps > > > > workqueues have changed.=20 > > >=20 > > > but the code here is always using the first CPU of a NUMA node or did= I > > > miss something? > > >=20 > >=20 > > The thing is the original way is to pick one CPU for a *RCU* node to > > run the grace-period work, but with your proposal, if a RCU node is > > smaller than a NUMA node (having fewer CPUs), we could end up having two > > grace-period works running on one CPU. I think that's Paul's concern. >=20 > Ah. Okay. From what I observed, the RCU nodes and NUMA nodes were 1:1 > here. Noted. Ok, in that case, there should be no significant performance difference. > Given that I can enqueue a work item on an offlined CPU I don't see why > commit fcc6354365015 ("rcu: Make expedited GPs handle CPU 0 being > offline") should make a difference. Any objections to just revert it? Well, that commit is trying to avoid queue a work on an offlined CPU, because according to workqueue API, it's the users' responsibility to make sure the CPU is online when a work item enqueued. So there is a difference ;-) But I don't have any objection to revert it with your proposal, since yours is more simple and straight-forward, and doesn't perform worse if NUMA nodes and RCU nodes have one-to-one corresponding. Besides, I think even if we observe some performance difference in the future, the best way to solve that is to make workqueue have a more fine-grained affine group than a NUMA node. Regards, Boqun >=20 > > Regards, > > Boqun >=20 > Sebastian --yNb1oOkm5a9FJOVX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlvEs1gACgkQSXnow7UH +riLhQgAl8b5Ic5ilwWUpkxrUEhRfcUDSSmpzzAdJEbueKFQAaLH1wp5Gi1M6QzL u7Klz03o4zpYcBnEXzaeZrewywkmbsPOi3/NGoxOV8vRdVl52XwyctqBUvL37UVp 4DGJxmnw2bwxVPa74n94LE72hdS1p6yCU7TKHQ9D57Q1qDHE16x4cQC/zlA62hlT vzUjyo61tV4gcngVQBao72EuIPNHRkbEktbJ9e8D/lcWIQEu1MXx2eQUeTDFGoKl sElQRxL5o+lUXztfuNVQ7RXY+e+kBUWZKyaa5hqFvSBj55OJBGN/2sGtvt0pAxW2 +FHaV9yWRKkMZmSNsDh8GVxqnaih7Q== =MozF -----END PGP SIGNATURE----- --yNb1oOkm5a9FJOVX--