Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1285097ybl; Fri, 10 Jan 2020 15:36:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzM2P9LxQdlOCliMR4dZcBholVw8Kx5VmBmPXe5nkFAcMEGDELESn4HVqH38haL+ieZjk8U X-Received: by 2002:aca:b943:: with SMTP id j64mr4508041oif.155.1578699389693; Fri, 10 Jan 2020 15:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578699389; cv=none; d=google.com; s=arc-20160816; b=dYzyQphufvS+zVFZDcKkQRljIdI0hWE8FIP7YydPTk1I9VCZKrCj5AliN129WYD4Gb HHryveXm36c4cMgIwTpAkKIymblM2Vtb1DkZ3t2eCueqRDrcvs/u6PbjTMy8z5zkOfwd w/O3N2SMvN+jb/CwXSsMRy4+fCbOjlsK72ahpjbF03igES8xXO5zKTtFNh+tB42Jhyjk QOc/WdWnQVxosYAgUlX6JzVm3MWh//kj9la2iZcOImsqSEnJ9oyX3wp5Am9J+aG08eU7 l5HQUGX3SKcF7oX3miV774aolnskNBmBGHuOAKJCVIagmR88ouny+B6DE+a0RuVeHE9A +QZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ss0uWBekAVqPTjKatRhHCULXZHZnoI/tdg7Om/65/i4=; b=jWEK1V1+oe4ULwXwi7yHr4hwAwhhA0/2MMDSYPdLZyGFD2ZGNNtWYq2/GLjP7I3Cf/ rA43ILRBh76ucYYDvkRWsMoC9mRqN5PrGTDHVrGwfHwQ/W70u2bUIZnfX0Hx2VlZAoRm 6Yj1kLMpc4MlnC2ZV74RaYU8LKs0b+exzrPA3OUnUc90OhSr+tBM0OIEU5GremjaNwLq 7tg6k2MCyli9pE/G4DpBLYdTtO8y5BD4qVE6JJu1X/v2jv1PE8rKvMR3ixyKcPt5+a9T c7NT/uZCje7LuX7MkxFGEC2EWgWSXS69bxcm6D+Jvd/3hNJzfoJpRxIUypnJ/2M+EQKM xf4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0P08jO7i; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si2407141otn.232.2020.01.10.15.36.16; Fri, 10 Jan 2020 15:36:29 -0800 (PST) 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=@kernel.org header.s=default header.b=0P08jO7i; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727550AbgAJXfM (ORCPT + 99 others); Fri, 10 Jan 2020 18:35:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:51946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727526AbgAJXfM (ORCPT ); Fri, 10 Jan 2020 18:35:12 -0500 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDDE3206ED; Fri, 10 Jan 2020 23:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578699311; bh=S6iFDCkFbQ19HKKXZUx+teh9fgyvoWfOoUF6jaPo1Aw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0P08jO7isuDezkc+9jiOHL9YWpG3bU2S3yJdL0/aZkEMjy9V1ND96KTuU0XD7Hr/+ zQBwan0ZRYcaAc+jeSWkOkWpeXJwVsmmBa6k82VMqKWpeddp8Q1Hj7cFlu5s3kl83c TYfbI6VFBGpsIbIVJ7JI3Tt0BamjBIhdlk9A9pzE= Date: Sat, 11 Jan 2020 08:35:07 +0900 From: Masami Hiramatsu To: Joel Fernandes Cc: Ingo Molnar , Anders Roxell , paulmck@kernel.org, "Naveen N . Rao" , Anil S Keshavamurthy , David Miller , Linux Kernel Mailing List Subject: Re: [PATCH -tip V2 0/2] kprobes: Fix RCU warning and cleanup Message-Id: <20200111083507.c32b85b1d47aa69928de530b@kernel.org> In-Reply-To: <20200110211438.GE128013@google.com> References: <157535316659.16485.11817291759382261088.stgit@devnote2> <20191221035541.69fc05613351b8dabd6e1a44@kernel.org> <20200107211535.233e7ff396f867ee1348178b@kernel.org> <20200110211438.GE128013@google.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joel and Paul, On Fri, 10 Jan 2020 16:14:38 -0500 Joel Fernandes wrote: > On Tue, Jan 07, 2020 at 09:15:35PM +0900, Masami Hiramatsu wrote: > > Hello, > > > > Anyone have any comment on this series? > > Without this series, I still see the suspicious RCU warning for kprobe on -tip tree. > > +Paul since RCU. > > Hi Masami, > > I believe I had commented before that I don't agree with this patch: > https://lore.kernel.org/lkml/157535318870.16485.6366477974356032624.stgit@devnote2/ > > The rationale you used is to replace RCU-api with non-RCU api just to avoid > warnings. I think a better approach is to use RCU api and pass the optional > expression to silence the false-positive warnings by informing the RCU API > about the fact that locks are held (similar to what we do for > rcu_dereference_protected()). The RCU API will do additional checking > (such as making sure preemption is disabled for safe RCU usage etc) as well. Yes, that is what I did in [1/2] for get_kprobe(). Let me clarify the RCU list usage in [2/2]. With the careful check, other list traversals never be done in non-sleepable context, those are always runs with kprobe_mutex held. If I correctly understand the Documentation/RCU/listRCU.rst, we should/can use non-RCU api for those cases, or do I miss something? Thank you, -- Masami Hiramatsu