Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp568033ybh; Wed, 18 Mar 2020 05:14:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vutJbtrlrCNzMOg8vM76dQPN7zSKuciGKUsmFmI4P1YAT17/d+/05fB1TW9spZIDChq0hlm X-Received: by 2002:a9d:3ea4:: with SMTP id b33mr3425598otc.136.1584533688337; Wed, 18 Mar 2020 05:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584533688; cv=none; d=google.com; s=arc-20160816; b=UxQyuUSqSBA1bP5XeHQIg5kRHA5OthMwJgRvQjHT83bD/HOTVxRcijdQcJ6JNPRvcg iSlWOnYV3Npn5oXB+QOs9LaWR3MJUdK2ilJe46jkVXnDVI2i69rYOfZygZbzrSNr9QSQ n4lgGMAXNq5F6FoocM/HEaweg+3K4/GwSI8whQc/QJHH7CqSc+y+mhCacWXN5sLZfNV0 9bPaCDwnSy73CwKyQhpJ5SKspJt61DSTN/psYwTY5j+iXDC+AVhTLGSfM7/7Swrp2iY2 jWukJ3s6cx8PQ2sstX4bCq45sBtQGlo0ZjTiLL5FihLDJB9A0urUReBvPs43Ax8plxAu akfw== 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=j5lq+ZeR1e5BLS61AhHY/9aQpgtc96UUH7xL5gfZlA4=; b=Lo+JiNBrJ2tpLBGyGxKvsj17czLMsJ5+34r8lRRPedQgzWXxkjrHA7eYLCM3PCCZPv vjkzu4kcQFOnMG4PQxVMh4Rqxv7EMiUagq9sbIXs0PO//hpUlZsNA67MYZ+xE/vPcVix AWsjDIlSz1J1wDwELOrmAkFHBEM+z8TWJ/RUK9S/oO3d+ye4i9dwrNM7/2I4pdJPXpj5 7HEvgeTRhDwsND50aHUUJiyKSsOd/0MPFIogj1Fy0QQIE9JkbvIr37YZ6ElS3sjRjLKr ymzRDdMo+hDAZ9pcXd4tVDsih9XzcgCiu6EFHEWutDDoMMpuByTSSIoZELU68/bIGjXq FRHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="CV/gd6Gb"; 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 y17si3121272oto.70.2020.03.18.05.14.34; Wed, 18 Mar 2020 05:14:48 -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=@ziepe.ca header.s=google header.b="CV/gd6Gb"; 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 S1726726AbgCRMN2 (ORCPT + 99 others); Wed, 18 Mar 2020 08:13:28 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42368 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgCRMN2 (ORCPT ); Wed, 18 Mar 2020 08:13:28 -0400 Received: by mail-qk1-f195.google.com with SMTP id e11so38143381qkg.9 for ; Wed, 18 Mar 2020 05:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=j5lq+ZeR1e5BLS61AhHY/9aQpgtc96UUH7xL5gfZlA4=; b=CV/gd6GbNBkHRzX6JGk52Gu52tpr+Ik38xHSjudsHMrtP3GG0SadQ/ERhtDU7kkGsE JgQEcYrOmU5agISimpX5xfwdM8s+z2RYoYxtH+/EZLht/quMchPcvOZnF+aJDxK1JKAB SFIbYlm7RqIlG6Ym6nJ4AM8uWuMtZ2VSK+DVdULVDkU/TE2VLsxbt4PLXTiL1wxEzmHU fMMLDzeinxdeV4YBUU38jrTyYx73QMmbDvX+wK6I+dusQ13+9ddEWjN0pwn+4s3UGI49 oIdENEBzAzVDXSq+LsGLqAc6sdMxQzVD6XbuZdzmV/Vid71g52WOdJyziDHTFeDNFdUq rtQA== 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=j5lq+ZeR1e5BLS61AhHY/9aQpgtc96UUH7xL5gfZlA4=; b=jYWnm5frdGrsaj0ecZnbabKXJGh4Tf8vPbaXMKdDS0u1o0m6IriZYYGKsrzN2ELqZA aIScpbiJpQK5jhR1cL+TxNB+Tovvjlg1sH9hygu3pqgTVI1gxu08Ywem8krtzdoxxcwa X3/W/B5gMHiiRHcMn/K234mmotCeKonw5Ur7j+qJoDioKCrpzJWohgQUlMz1kagn3hLz yjzRJuS4WkXphsDeaC6cUksy4lsIowk6doIZwchy0XgMm0sKu7fURghkLkFYqt/2k0j/ fdQOfvnhkNbTfrySOZMyH24yJ68P/8DNqn+haHCglwHWo+SbaBa2nQopd3feOZ+1IerL 4dBQ== X-Gm-Message-State: ANhLgQ1jDBKH9Pxa+9/d+6RdW/b5oB5dQli8SGAjtY6xbJ16aBJDjbde r1tysleLY+OxkEXb3+FfLwtOgQ== X-Received: by 2002:a37:aa54:: with SMTP id t81mr3827143qke.234.1584533607354; Wed, 18 Mar 2020 05:13:27 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id p25sm312216qkm.97.2020.03.18.05.13.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Mar 2020 05:13:26 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jEXZe-0003a7-6B; Wed, 18 Mar 2020 09:13:26 -0300 Date: Wed, 18 Mar 2020 09:13:26 -0300 From: Jason Gunthorpe To: Qian Cai Cc: akpm@linux-foundation.org, paulmck@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/mmu_notifier: silence PROVE_RCU_LIST warnings Message-ID: <20200318121326.GZ20941@ziepe.ca> References: <20200317175640.2047-1-cai@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200317175640.2047-1-cai@lca.pw> 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 On Tue, Mar 17, 2020 at 01:56:40PM -0400, Qian Cai wrote: > It is safe to traverse mm->notifier_subscriptions->list either under > SRCU read lock or mm->notifier_subscriptions->lock using > hlist_for_each_entry_rcu(). Silence the PROVE_RCU_LIST false positives, > for example, > > WARNING: suspicious RCU usage > ----------------------------- > mm/mmu_notifier.c:484 RCU-list traversed in non-reader section!! > > other info that might help us debug this: > > rcu_scheduler_active = 2, debug_locks = 1 > 3 locks held by libvirtd/802: > #0: ffff9321e3f58148 (&mm->mmap_sem#2){++++}, at: do_mprotect_pkey+0xe1/0x3e0 > #1: ffffffff91ae6160 (mmu_notifier_invalidate_range_start){+.+.}, at: change_p4d_range+0x5fa/0x800 > #2: ffffffff91ae6e08 (srcu){....}, at: __mmu_notifier_invalidate_range_start+0x178/0x460 > > stack backtrace: > CPU: 7 PID: 802 Comm: libvirtd Tainted: G I 5.6.0-rc6-next-20200317+ #2 > Hardware name: HP ProLiant BL460c Gen8, BIOS I31 11/02/2014 > Call Trace: > dump_stack+0xa4/0xfe > lockdep_rcu_suspicious+0xeb/0xf5 > __mmu_notifier_invalidate_range_start+0x3ff/0x460 > change_p4d_range+0x746/0x800 > change_protection+0x1df/0x300 > mprotect_fixup+0x245/0x3e0 > do_mprotect_pkey+0x23b/0x3e0 > __x64_sys_mprotect+0x51/0x70 > do_syscall_64+0x91/0xae8 > entry_SYSCALL_64_after_hwframe+0x49/0xb3 > > Signed-off-by: Qian Cai > --- > mm/mmu_notifier.c | 27 ++++++++++++++++++--------- > 1 file changed, 18 insertions(+), 9 deletions(-) Looks right to me Reviewed-by: Jason Gunthorpe This was missed during testing because we don't run with PROVE_RCU_LIST enabled Jason