From patchwork Fri Jun 14 00:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10993981 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 AA3FA924 for ; Fri, 14 Jun 2019 00:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94F0A1FEBA for ; Fri, 14 Jun 2019 00:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 881FA26224; Fri, 14 Jun 2019 00:45:20 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable 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 2665E1FEBA for ; Fri, 14 Jun 2019 00:45:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6844D6B0272; Thu, 13 Jun 2019 20:45:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4FCC06B0273; Thu, 13 Jun 2019 20:45:00 -0400 (EDT) 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 2D6CF6B0274; Thu, 13 Jun 2019 20:45:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by kanga.kvack.org (Postfix) with ESMTP id 023466B0272 for ; Thu, 13 Jun 2019 20:45:00 -0400 (EDT) Received: by mail-qt1-f197.google.com with SMTP id v58so732771qta.2 for ; Thu, 13 Jun 2019 17:44:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=x2xcZ0hUzEe5obPQKOQJn2EFwkT6zfHmS/ojlfdj62g=; b=IggjAGeOwnSmGbaPpkQdZWJfEvKlQiCV+sdWcYZYtPsx8c1XuulvcT1D9mPYZsGmza XSG3Vj9q1wsroP//rnaQjto3BEnfZbueCFSJW3HFE7arkM4jHPvifZVibX4mAwI3CpXd s7u0oIGblbcqmcNe1uFCQeLolnTUQvwYqwqk1Kp0SGUJuWyy5MRKB6EoQOjGG/+OPOJg AoV7+l+mpoMmwpy6Avna6ryU5gbp3UfHAl84cyhvKLJ9VUp5p9C4H3AGHix65eqx9Heh xYQQ5LA4pv+4mwg3utrmV0eiX/cqrTCWzuIp9t8Ee1SKRWxyuPnn2osMmdWLrJGf6cRE GVSQ== X-Gm-Message-State: APjAAAVhDeP3Har2+kintKtWVs3tvz2oJyPp5Kpag35GCHuU8WfAXJGv GgIZWLDuWV+CTW/72moK/yGc/3IytwubAX0mUKU+TZ7np3G3AyHzEf9zlxZtX2p5qNT1cCha6O+ PcVR/0NnfbPpnNit13dLn6exmSotO9AOOsusypC5z79T0yGWPWKzRjJVQbOAf3dRs/g== X-Received: by 2002:a05:620a:147:: with SMTP id e7mr72760190qkn.247.1560473099774; Thu, 13 Jun 2019 17:44:59 -0700 (PDT) X-Received: by 2002:a05:620a:147:: with SMTP id e7mr72760171qkn.247.1560473099240; Thu, 13 Jun 2019 17:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560473099; cv=none; d=google.com; s=arc-20160816; b=CUR0TfA3K3vfWeZIs7st+ut8PCNZ07pJRZFW/V4UQgwAif2KWkvFWo5ngvCqF7VoAt +sDHWA1vkpCR2KDBNCNIRssORnAlBPTw0Z1OkLOuOmfBFJQtCyPKi4FpOkZwrQgd+ZPv pwUEwiN63IB6dqwsIFBvNC7vp8hO7CfEl3YS8N6NZ+Mn5I7JC8iSTFMdEoDRTsz2WF4R eBGvPbZBSxO8zxRByPMXaEUdau2iUmXyXVE7ygzRUuem8zzKvfDlSq1gNe1wlGqK63T7 4yQPKgSiWmraeySPKWoRmadYQItMly+70QzBzK788cA72TT6n5HzBLGxqGlSlippSJq5 XulA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=x2xcZ0hUzEe5obPQKOQJn2EFwkT6zfHmS/ojlfdj62g=; b=ruaOOkho3g1o3z92j4gOLmvzbxwGJETCy1X9AVkpXMU882YcROucZo7L7bBSZzEWMW 9cDXs2DSU2jJ6/cfdhuOdbtRjxP0sYeAXtif91ALq0K2sgyYJVwXConjp0DdgtWpCP5l IAMfIeiNjU3j6bH5CBW9mNW7gAv7Ny+pbCrGfcmlxqRZTzcmxgPZkvk52UlHxllDyS20 2Muc9qCndQLSBg3FMj1TR0+5TmeR3+MX35CiyypwmsAUCRkS4O3dkSLNzC1QDkfiDbQJ j55CDCH7jI07hQVYmCBUsIixkTGshA9Tdtc2QlWTS9Cq8953XUIzlol1NjieIC+HZaA2 yNWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=fmkDVzgS; spf=pass (google.com: domain of jgg@ziepe.ca designates 209.85.220.65 as permitted sender) smtp.mailfrom=jgg@ziepe.ca Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id n1sor1033422qkd.102.2019.06.13.17.44.59 for (Google Transport Security); Thu, 13 Jun 2019 17:44:59 -0700 (PDT) Received-SPF: pass (google.com: domain of jgg@ziepe.ca designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=fmkDVzgS; spf=pass (google.com: domain of jgg@ziepe.ca designates 209.85.220.65 as permitted sender) smtp.mailfrom=jgg@ziepe.ca DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x2xcZ0hUzEe5obPQKOQJn2EFwkT6zfHmS/ojlfdj62g=; b=fmkDVzgS2vVrdEiIFYVAnbf6P4BATGmI5DV7vsT+OeMjI4tAox+P6sovJkfdiZ77nO TT+3owVCCkhWvSGoSNguAk+3EcblRkw7UWgxiYOoQUIg3Krv9JVjCiJAQm/Z0vfo/EQO KilEhiFU8QK10vlLGWCYF1bTI+QT+GOn8FgfKnRlLwynY8K2mvFNbldzrI4Lge3bpnfB LwwdBdhl/qwje1Wf18PrfGX26/MhvkXIgT48JtyA/Mh0PWYhgZzhVUdAvgS8HFf+7d0p m4F365LJ+Y/0qG+JXDxYUTDe3aQRit0hcrauKtBkjsXKtLtzRJ2lxMjKyKDLXCmxU6K9 9xfw== X-Google-Smtp-Source: APXvYqzCPZOcBvdDvO5A/+aWYFKA+YngTOxLtxM859wIOaaSHbD/Xj8J7AD4AHMtWoKrqY+ZKezZsg== X-Received: by 2002:a05:620a:1661:: with SMTP id d1mr13812583qko.192.1560473099006; Thu, 13 Jun 2019 17:44:59 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id q56sm978355qtq.64.2019.06.13.17.44.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 17:44:54 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hbaKs-0005KQ-1j; Thu, 13 Jun 2019 21:44:54 -0300 From: Jason Gunthorpe To: Jerome Glisse , Ralph Campbell , John Hubbard , Felix.Kuehling@amd.com Cc: linux-rdma@vger.kernel.org, linux-mm@kvack.org, Andrea Arcangeli , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Ben Skeggs , Jason Gunthorpe , Souptick Joarder , Ira Weiny , Philip Yang Subject: [PATCH v3 hmm 10/12] mm/hmm: Do not use list*_rcu() for hmm->ranges Date: Thu, 13 Jun 2019 21:44:48 -0300 Message-Id: <20190614004450.20252-11-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190614004450.20252-1-jgg@ziepe.ca> References: <20190614004450.20252-1-jgg@ziepe.ca> 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 From: Jason Gunthorpe This list is always read and written while holding hmm->lock so there is no need for the confusing _rcu annotations. Signed-off-by: Jason Gunthorpe Reviewed-by: Jérôme Glisse Reviewed-by: John Hubbard Acked-by: Souptick Joarder Reviewed-by: Ralph Campbell Acked-by: Souptick Joarder Reviewed-by: Ira Weiny Tested-by: Philip Yang Signed-off-by: Christoph Hellwig --- mm/hmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/hmm.c b/mm/hmm.c index e214668cba3474..26af511cbdd075 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -908,7 +908,7 @@ int hmm_range_register(struct hmm_range *range, range->hmm = hmm; kref_get(&hmm->kref); - list_add_rcu(&range->list, &hmm->ranges); + list_add(&range->list, &hmm->ranges); /* * If there are any concurrent notifiers we have to wait for them for @@ -934,7 +934,7 @@ void hmm_range_unregister(struct hmm_range *range) struct hmm *hmm = range->hmm; mutex_lock(&hmm->lock); - list_del_rcu(&range->list); + list_del(&range->list); mutex_unlock(&hmm->lock); /* Drop reference taken by hmm_range_register() */