From patchwork Mon Nov 5 19:29:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 10669037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48C281709 for ; Mon, 5 Nov 2018 19:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3248729B09 for ; Mon, 5 Nov 2018 19:31:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 260D329C14; Mon, 5 Nov 2018 19:31:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY autolearn=no version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E9B229B09 for ; Mon, 5 Nov 2018 19:30:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2A976B0003; Mon, 5 Nov 2018 14:30:57 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CDA5A6B0006; Mon, 5 Nov 2018 14:30:57 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF2166B0007; Mon, 5 Nov 2018 14:30:57 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id 7E2436B0003 for ; Mon, 5 Nov 2018 14:30:57 -0500 (EST) Received: by mail-pf1-f200.google.com with SMTP id b15-v6so5577036pfo.3 for ; Mon, 05 Nov 2018 11:30:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; bh=g/QxvG3YR3QpKHhhiTJ96raVgd4KRuIWRks8cVjGon0=; b=M30DkZ+IwjytgpDC8LWHxp6VPkkBrNEz0FCjcxB1qCRRmSOi5J7rw0wq625zNRNQjK EqBSj7ci0XiMX0DFpR/3CCwwq8VqCsjn9PtHn5oh+R9YK7qA2bZVgEm/MPfNnqxag8Lu E6oJffpE3P39EbYkafhFee7wYjKcWVi3ycod2548do3joT4xO6T/aHe3TtlGvjPl8GwU 16pCNnIIEhnYHpdn/sosy5jLVvAbW9254FiKTX0lQqVkDmy2E/nRt0gmtj0iueVsm3QT e9QLsNdSvEZltpc5+hyLeULvnL7ji/0trcg5TRL+FHy5sNryhCMdrzGigOFlilpFJecV GlZQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of sean.j.christopherson@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=sean.j.christopherson@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AGRZ1gLwxExScMa8BOFYGqjsX7F5m/hXqbVLYWLktJX50Kh8H72NBR3z KniymElGgI2zpZoaKCUUwOrkBmxwICIWZUDxH4cIZzc2lxOTtVwWni8FNEptQwziZ7xQCZ3NonF qPntU1+oGywFk+5RBjDUJQntayY+5KhxDondu6R20BCAgrmLrOt+Pcy9twfFHtpGU5w== X-Received: by 2002:a65:638a:: with SMTP id h10-v6mr21301571pgv.136.1541446257028; Mon, 05 Nov 2018 11:30:57 -0800 (PST) X-Google-Smtp-Source: AJdET5fk6dVDXiWb6sRSSDCQvxnnRIwbvpv4/d+Q6YHgbxbTtVcXmIha5rWzeySyc/TRh8lvBlsz X-Received: by 2002:a65:638a:: with SMTP id h10-v6mr21301536pgv.136.1541446256173; Mon, 05 Nov 2018 11:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541446256; cv=none; d=google.com; s=arc-20160816; b=vXZZxCwE7Ejiz3ke3XEFjmsfwchu2ulYPdho5w+MsEtLH8Ny63fK/F9Mh0srXnhVp8 j+5KTmIsghvS3PW0akah9vrXjSWS5MO81qRl7MlUkwUnbEEvVfsTNKagn0S3Ppx7ZpQv RO7G9fc+wmwVQdG0zBbtAX3X7zwpz8aCpTwUsFIOqjt80LHbhumun4Rwy9ydjw+YytxD 9+9nrhs1lUnaoCVR5Uhdg0RHKRsLNHC35dlcNXJtMoJOoskGERJnGmqtNYuEZz5vZVA+ Sl5RPrNLUUWBZiHJ+QJqKfOt3F5ZMYpBFiG4OwIoMsQrmo3dkDI1a1eXM/0ac3d24m4n VjMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=g/QxvG3YR3QpKHhhiTJ96raVgd4KRuIWRks8cVjGon0=; b=FepxmRc8KuP/KK8uOdp1dNJ8GVWJtJIH25S8KB12j9ChkiPhhbXT7H67luW1pMr6k9 mJUF9KNU+KXkqRnKzeINdp+SZGWRKc6yeAkUQwQoUzYBCMXqLruYRFU4oBjaLlGvNZrp Xqme6yb5z/+an4k21q0mmCboweK8xaXwNIWfZcjwvskDt5P1gK5FU+KGWxFgoYf7u+OH /6PTUparRO4bgOQ3VPFrpbyuFYtrUKGz59yR4z3lT6Vl4vU6c781pyS/ZpEGwPU4fyuH 73MtF8bwv6HdsTT239zMzi9/AOYb50c0lHzl2HXbVQsva5b3BNI/MaZA7Bn6iRGd3zpy r7Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of sean.j.christopherson@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=sean.j.christopherson@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga05.intel.com (mga05.intel.com. [192.55.52.43]) by mx.google.com with ESMTPS id u34si988293pgk.24.2018.11.05.11.30.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:30:56 -0800 (PST) Received-SPF: pass (google.com: domain of sean.j.christopherson@intel.com designates 192.55.52.43 as permitted sender) client-ip=192.55.52.43; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sean.j.christopherson@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=sean.j.christopherson@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 11:30:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="89641431" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.154]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2018 11:30:55 -0800 From: Sean Christopherson To: Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Oded Gabbay Subject: [PATCH] mm/mmu_notifier: rename mmu_notifier_synchronize() to <...>_barrier() Date: Mon, 5 Nov 2018 11:29:55 -0800 Message-Id: <20181105192955.26305-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP ...and update its comment to explicitly reference its association with mmu_notifier_call_srcu(). Contrary to its name, mmu_notifier_synchronize() does not synchronize the notifier's SRCU instance, but rather waits for RCU callbacks to finished, i.e. it invokes rcu_barrier(). The RCU documentation is quite clear on this matter, explicitly calling out that rcu_barrier() does not imply synchronize_rcu(). The misnomer could lean an unwary developer to incorrectly assume that mmu_notifier_synchronize() can be used in conjunction with mmu_notifier_unregister_no_release() to implement a variation of mmu_notifier_unregister() that synchronizes SRCU without invoking ->release. A Documentation-allergic and hasty developer could be further confused by the fact that rcu_barrier() is indeed a pass-through to synchronize_rcu()... in tiny SRCU. Signed-off-by: Sean Christopherson --- mm/mmu_notifier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index 5119ff846769..46ebea6483bf 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -35,12 +35,12 @@ void mmu_notifier_call_srcu(struct rcu_head *rcu, } EXPORT_SYMBOL_GPL(mmu_notifier_call_srcu); -void mmu_notifier_synchronize(void) +void mmu_notifier_barrier(void) { - /* Wait for any running method to finish. */ + /* Wait for any running RCU callbacks (see above) to finish. */ srcu_barrier(&srcu); } -EXPORT_SYMBOL_GPL(mmu_notifier_synchronize); +EXPORT_SYMBOL_GPL(mmu_notifier_barrier); /* * This function can't run concurrently against mmu_notifier_register