Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1602399ybi; Fri, 12 Jul 2019 20:03:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJP6fu2kHir+xXr/rleGANQO1r9ZB9IQ2z+BYiJvUU7l2ybaHk7EVfiDfSSr0qa6/qxYTy X-Received: by 2002:a63:5b52:: with SMTP id l18mr14757714pgm.21.1562986998387; Fri, 12 Jul 2019 20:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562986998; cv=none; d=google.com; s=arc-20160816; b=bBoVs0mQE3AiNh7WVc5OtxS7QZ04HlKFJ2AbplYn0/LtfWnsQqIWmmtS8AmY+ysSHe 7RtnCNRJ9y4pfB1ekmMxjHS2OoiZ/pO3KrYSGthroXkwd0sf31CRp0efMcjg+sDqemdi c7huyefvyBeJy4FNFcORmvWHsqz0LlhaERGK0N0o394ZuMUPme2lHrJDhPUpUwvp4yAd I6Ot0Vq9SwJfgFPJH5g7YieaUU8NpcsCAfM3/aPmBWP0sX7vNUvW50a76CpMclc+kPT2 pjal3XV3PKUN53+wPufHJ2KkGPWlbILqI8bUUDQBunbCio4Ugu0hvpg+254S1sYuJ5MR X2Gg== 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=p6+nGdMMoAyv7FCZrJDVnq6Bce28UfZTF5kGPY0RsIM=; b=huRL83XY75WAR0RwVZeWkdFp4n2W+lXSaqhbnjybfOlWgEZtNBnDwjqQheWQsf4qN5 zJOtKSqqD4kQAbH6tH7pTpa8KbdMh9SuxVACoG7YxTHeYFE0dhg2UPuigJhiMYm73Gf3 oflS4wCHBGIIhLe3UmgRNEhG2ncO6IzUzr9GFV4B3zAouk9a+Im4M1m27nls9euCgQUs NxsA1LgYysnumBbeKL6lFVDP1zY8o9wF76/HoCzkICYQcNSxfKUu4NEtc/DgDB7LyX09 glSoCqHCUutzhC5BwV5LLf4ber3vrUQsL1IJpZ3dj70cvL/c6Gm0cCfdInwYJ8PUrkkz UTEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=bw04Ay0U; 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 l68si9631563plb.416.2019.07.12.20.02.50; Fri, 12 Jul 2019 20:03:18 -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=@joelfernandes.org header.s=google header.b=bw04Ay0U; 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 S1727551AbfGMDBy (ORCPT + 99 others); Fri, 12 Jul 2019 23:01:54 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40527 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbfGMDBx (ORCPT ); Fri, 12 Jul 2019 23:01:53 -0400 Received: by mail-pl1-f196.google.com with SMTP id a93so5661791pla.7 for ; Fri, 12 Jul 2019 20:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p6+nGdMMoAyv7FCZrJDVnq6Bce28UfZTF5kGPY0RsIM=; b=bw04Ay0UMFt9ke3ViraFjTTPFj69KfioIz2kDu9iThosxnwpoLgu7SKLG4hIRxFIqy KrRWGgfWL0xcUlDIw7iLZ5tX+hclnd6IfuCTeOlLadmHAEqoiMpGN+V7xL6DjEvbJKAq nM4p5eZKLdUhl/xP3nkE1+7gdBiGtiXeF2kvg= 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=p6+nGdMMoAyv7FCZrJDVnq6Bce28UfZTF5kGPY0RsIM=; b=FcDGQ70x5ibNmhiu1po6Mnszr655PDIsp3pCkow8tDgS/f7ZknBYdw7ENtIFF2t0Yp kaLML3ZUNgZxC8uHkDkVAaB7GgL1wLwqqfytvye65kZsn7TF7yJ6SXQpoeLZ6tXjpty4 ZAI5NRTsTtHFr5OFGz0356LpheiWXO5wC2D/2bqRleDcI31vDN8eWdpN4QVXl5MVg0hZ 2xMdDy1Cqi2jdZBOxotEn5YdAoNo35amX6hFmUv2VLolL2LeZKG+dHbeZQszEqczfKB/ leF8oKFlVaEfq6zaGUnnbB3mRUBrz+EOUUDPMkbwI4wSjSv610RCv/QI/qCMYy3HyLmL LG3A== X-Gm-Message-State: APjAAAWkb9E0M/IIWsg1OGAKE+7FKPHmQDNn/COZN/ySkrDHDzYHzDId 9mFS3K03DYxhONBgFIniI8oUMa1y X-Received: by 2002:a17:902:e2:: with SMTP id a89mr15623529pla.210.1562986912505; Fri, 12 Jul 2019 20:01:52 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id m6sm9898170pfb.151.2019.07.12.20.01.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 20:01:51 -0700 (PDT) Date: Fri, 12 Jul 2019 23:01:50 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Oleg Nesterov , Alexey Kuznetsov , Bjorn Helgaas , Borislav Petkov , c0d1n61at3@gmail.com, "David S. Miller" , edumazet@google.com, Greg Kroah-Hartman , Hideaki YOSHIFUJI , "H. Peter Anvin" , Ingo Molnar , Jonathan Corbet , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers , neilb@suse.com, netdev@vger.kernel.org, Pavel Machek , peterz@infradead.org, "Rafael J. Wysocki" , Rasmus Villemoes , rcu@vger.kernel.org, Steven Rostedt , Tejun Heo , Thomas Gleixner , will@kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v2 3/9] rcu/sync: Remove custom check for reader-section Message-ID: <20190713030150.GA246587@google.com> References: <20190712170024.111093-1-joel@joelfernandes.org> <20190712170024.111093-4-joel@joelfernandes.org> <20190712213559.GA175138@google.com> <20190712233206.GZ26519@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190712233206.GZ26519@linux.ibm.com> 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 On Fri, Jul 12, 2019 at 04:32:06PM -0700, Paul E. McKenney wrote: > On Fri, Jul 12, 2019 at 05:35:59PM -0400, Joel Fernandes wrote: > > On Fri, Jul 12, 2019 at 01:00:18PM -0400, Joel Fernandes (Google) wrote: > > > The rcu/sync code was doing its own check whether we are in a reader > > > section. With RCU consolidating flavors and the generic helper added in > > > this series, this is no longer need. We can just use the generic helper > > > and it results in a nice cleanup. > > > > > > Cc: Oleg Nesterov > > > Signed-off-by: Joel Fernandes (Google) > > > > Hi Oleg, > > Slightly unrelated to the patch, > > I tried hard to understand this comment below in percpu_down_read() but no dice. > > > > I do understand how rcu sync and percpu rwsem works, however the comment > > below didn't make much sense to me. For one, there's no readers_fast anymore > > so I did not follow what readers_fast means. Could the comment be updated to > > reflect latest changes? > > Also could you help understand how is a writer not able to change > > sem->state and count the per-cpu read counters at the same time as the > > comment tries to say? > > > > /* > > * We are in an RCU-sched read-side critical section, so the writer > > * cannot both change sem->state from readers_fast and start checking > > * counters while we are here. So if we see !sem->state, we know that > > * the writer won't be checking until we're past the preempt_enable() > > * and that once the synchronize_rcu() is done, the writer will see > > * anything we did within this RCU-sched read-size critical section. > > */ > > > > Also, > > I guess we could get rid of all of the gp_ops struct stuff now that since all > > the callbacks are the same now. I will post that as a follow-up patch to this > > series. > > Hello, Joel, > > Oleg has a set of patches updating this code that just hit mainline > this week. These patches get rid of the code that previously handled > RCU's multiple flavors. Or are you looking at current mainline and > me just missing your point? > Hi Paul, You are right on point. I have a bad habit of not rebasing my trees. In this case the feature branch of mine in concern was based on v5.1. Needless to say, I need to rebase my tree. Yes, this sync clean up patch does conflict when I rebase, but other patches rebase just fine. The 2 options I see are: 1. Let us drop this patch for now and I resend it later. 2. I resend all patches based on Linus's master branch. thanks, - Joel