From: Qian Cai Date: Wed, 27 May 2020 01:22:45 +0000 Subject: Re: [PATCH] powerpc/kvm/book3s64/vio: fix some RCU-list locks Message-Id: <20200527012245.GJ991@lca.pw> List-Id: References: <20200510051834.2011-1-cai@lca.pw> <20200527011323.GA293451@thinks.paulus.ozlabs.org> In-Reply-To: <20200527011323.GA293451@thinks.paulus.ozlabs.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras Cc: mpe@ellerman.id.au, benh@kernel.crashing.org, aik@ozlabs.ru, paulmck@kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 11:13:23AM +1000, Paul Mackerras wrote: > On Sun, May 10, 2020 at 01:18:34AM -0400, Qian Cai wrote: > > It is unsafe to traverse kvm->arch.spapr_tce_tables and > > stt->iommu_tables without the RCU read lock held. Also, add > > cond_resched_rcu() in places with the RCU read lock held that could take > > a while to finish. > > This mostly looks fine. The cond_resched_rcu() in kvmppc_tce_validate > doesn't seem necessary (the list would rarely have more than a few > dozen entries) and could be a performance problem given that TCE > validation is a hot-path. > > Are you OK with me modifying the patch to take out that > cond_resched_rcu(), or is there some reason why it's essential that it > be there? Feel free to take out that cond_resched_rcu(). Your reasoning makes sense.