From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 917EBC64E7B for ; Tue, 1 Dec 2020 21:31:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6BA2208FE for ; Tue, 1 Dec 2020 21:31:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6BA2208FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 203F46B0036; Tue, 1 Dec 2020 16:31:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B4876B005D; Tue, 1 Dec 2020 16:31:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CAE28D0001; Tue, 1 Dec 2020 16:31:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id E79A46B0036 for ; Tue, 1 Dec 2020 16:31:10 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ABC8F363B for ; Tue, 1 Dec 2020 21:31:10 +0000 (UTC) X-FDA: 77546009100.08.size37_50020d5273ad Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 8073D1819E627 for ; Tue, 1 Dec 2020 21:31:10 +0000 (UTC) X-HE-Tag: size37_50020d5273ad X-Filterd-Recvd-Size: 2552 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Dec 2020 21:31:09 +0000 (UTC) Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 63B58208C3; Tue, 1 Dec 2020 21:31:06 +0000 (UTC) Date: Tue, 1 Dec 2020 16:31:04 -0500 From: Steven Rostedt To: Axel Rasmussen Cc: Andrew Morton , Chinwen Chang , Daniel Jordan , David Rientjes , Davidlohr Bueso , Ingo Molnar , Jann Horn , Laurent Dufour , Michel Lespinasse , Stephen Rothwell , Vlastimil Babka , Yafang Shao , davem@davemloft.net, dsahern@kernel.org, gregkh@linuxfoundation.org, kuba@kernel.org, liuhangbin@gmail.com, tj@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints Message-ID: <20201201163104.5d178986@gandalf.local.home> In-Reply-To: <20201201162847.654f3013@gandalf.local.home> References: <20201201203249.4172751-1-axelrasmussen@google.com> <20201201162847.654f3013@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 1 Dec 2020 16:28:47 -0500 Steven Rostedt wrote: > On Tue, 1 Dec 2020 12:32:49 -0800 > Axel Rasmussen wrote: > > > +/* Called with reg_lock held. */ > > The above comment is reduntant, as the lockdep_is_held() below also suggest > that it is ;-) > > > > static inline char *get_memcg_path_buf(void) > > { > > + char *buf; > > int idx; > > > > + rcu_read_lock(); > > The caller of get_mm_memcg_path() has preemption disabled, which is also > now an RCU lock. So the rcu_read_lock() is somewhat redundant. BTW, both of these comments are FYI. You can keep the comment and keep the rcu_read_lock(). I was just stating that they are redundant, but keeping them may make the code a bit more robust. -- Steve