Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3233190imm; Sun, 7 Oct 2018 23:51:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV63WlfWMxidEjae2NzINZ2j+FKgSPsXZfyRIjxrpPqWIzT+yE9fo/ltin7lPiJsnPDSlVchx X-Received: by 2002:a63:1148:: with SMTP id 8-v6mr20243016pgr.172.1538981482761; Sun, 07 Oct 2018 23:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538981482; cv=none; d=google.com; s=arc-20160816; b=0FkdlvuZffhrd7M9a/zQAMr89SEgknA92kfVqjg12qQZdkreGe5YM7pTypWZDtux7d qbTy3Mqo24QwjYuf6fRbPpOJ1P/c5HaUUHhfLI1DZufycw7r/9G3bfCT06P7rk4ukZOY ek4kiDAwgdKzjhnqff1+0nZ/IITpEOK2jfy6IOBAI8fP87LYQgO3fwXzsfpchjSfN+gI 3e5kxfHFVUOIoC1dUPbq5fWSE1CYGOUqQvIn9xq0WMGZoNuoMrlxwgqzwRvgk3pltYlb aPWWpDq56kLULTXiXFjyZCulrPK6WVakT6kduB7VXLboZ8R0EwIS1toIssMltSSEjyeO IMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:cc:to:from:message-id :dkim-signature; bh=6GL5Got849NgxaKHgCNqnO2F9SDVP3AMUXGGmTFDH98=; b=J1hOoyFlGzHNOSATLiFc5P6gZtcHbpDBqdyPVfODPZruVbLbMosyHvkuq52+WMI5TM uSFh3b5tgu7StsbNPupMZhhFE9TXOVGqyUQ5OJKWs+KFS+fQNMDB/LM+YfxkcHjBS+40 yecBNFKLmyvyfhzGmV96pdb+r+3ErcGF0g2wf4RFgISP+WR0tpzq5KPyFXg8nAcxRgj6 tcUYEf6upaZzQzVJJuVJNfNbjzWfLS25IVI4WP0oyDziiJTmAsg59d52N31DRZzpZSuL WWBT68ZgF+nsWAua9KTP2C5PUQm+VoQ2qtqYz9cEyA4512MoHEHWnqGhJ4Rzuf79toRt c1Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WKjgnvLc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6-v6si16381804plr.91.2018.10.07.23.51.07; Sun, 07 Oct 2018 23:51:22 -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=@gmail.com header.s=20161025 header.b=WKjgnvLc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbeJHOBN (ORCPT + 99 others); Mon, 8 Oct 2018 10:01:13 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34293 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbeJHOBN (ORCPT ); Mon, 8 Oct 2018 10:01:13 -0400 Received: by mail-pg1-f195.google.com with SMTP id g12-v6so7396581pgs.1 for ; Sun, 07 Oct 2018 23:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:cc:subject:date; bh=6GL5Got849NgxaKHgCNqnO2F9SDVP3AMUXGGmTFDH98=; b=WKjgnvLcQ2lTV/BwaLDobehdmYZxpfp8NQ3M//PUBco9emDrX33gYbMUHDZmYRjEKx cNk7wE8tgZnDdwNLkVfbqWefbiAbX8nnC8gO0pqC3v52QQFpVnda8ZVPd6JP7oHsiy0r pupuEMIuuOWqhGuHzpk1ppsXEmrCzVzJcZoyDgeWhBserkYcckvCTJK1//B2Ijhgvq8l vKXkbZ9X3QWXhWA6l6yXr1Q+SxQq0p5+KUb6ero8jrIgv6vLdeXXS6j7gTAVMPsQalQV KDIBPzyppkRFw6pj3e0wNofiwYOBZXQbtKuEOMtBcITuEf0Gqy2YDwbqG7QOYtZsxquF /LcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:cc:subject:date; bh=6GL5Got849NgxaKHgCNqnO2F9SDVP3AMUXGGmTFDH98=; b=fa6HxcmphfYAmk+5X5LS3iRkv4kNWzr1fwsBzpulJ066o3QvwUfBbaqyisDvFo+Xzr 9mN1xBRbSR5nHCJjBaTBZIzmx8HoBL5WtIaRKatJtRhz0NwwmUh1/cIYJAXSrSJnMVnl Fb/9KX4Okn727uXxIqJOdlIfk8FXHluG+aL9ErbuABGGwogt+Ty5VFuRy21VGiRhGQlF TQjiVOZnLXmCEHAS4aZchZojzKiVhQKu8oyWUWQmetVtaxNaTVwFJVGZAtyoQTfkXrTg vNgtoXbPOYyCqUqphleWHfnkv8i1QWenBnBh+8vfXvYa1N3/eCEhVDiWyL87UsJvyp2J C8eQ== X-Gm-Message-State: ABuFfoiHsHKcPH14itmIgpNKWgMnWgbJuKtsG0jRVtAeL8jbtIZhBBg2 smxlGcvOvfMnUaaW5Pk7KYh1LZwc X-Received: by 2002:a63:bd41:: with SMTP id d1-v6mr19862594pgp.309.1538981461407; Sun, 07 Oct 2018 23:51:01 -0700 (PDT) Received: from localhost.localdomain ([118.193.167.117]) by smtp.gmail.com with ESMTPSA id u184-v6sm30447270pgd.27.2018.10.07.23.50.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Oct 2018 23:51:00 -0700 (PDT) Message-ID: <5bbafe54.1c69fb81.954a9.deae@mx.google.com> X-Google-Original-Message-ID: <1538981441-11687-1-git-send-email-y> From: zhouzhouyi@gmail.com X-Google-Original-From: y To: paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org Cc: Zhouyi Zhou Subject: [PATCH] RCU: Adjust the comment of function rcu_is_watching Date: Mon, 8 Oct 2018 06:50:41 +0000 X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhouyi Zhou Because RCU avoids interrupting idle CPUs, rcu_is_watching is used to test whether or not it is currently legal to run RCU read-side critical sections on this CPU. First sentence and last sentence of current comment for rcu_is_watching have opposite meaning of what is expected. Signed-off-by: Zhouyi Zhou --- kernel/rcu/tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 0b760c1..adb04ea 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1010,12 +1010,12 @@ void rcu_irq_enter_irqson(void) } /** - * rcu_is_watching - see if RCU thinks that the current CPU is idle + * rcu_is_watching - see if RCU thinks that the current CPU is not idle * * Return true if RCU is watching the running CPU, which means that this * CPU can safely enter RCU read-side critical sections. In other words, - * if the current CPU is in its idle loop and is neither in an interrupt - * or NMI handler, return true. + * if the current CPU is not in its idle loop or is in an interrupt or + * NMI handler, return true. */ bool notrace rcu_is_watching(void) { -- 2.1.4