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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A609ECAAD3 for ; Thu, 1 Sep 2022 20:22:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 048828004E; Thu, 1 Sep 2022 16:22:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3A808000D; Thu, 1 Sep 2022 16:22:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDB228004E; Thu, 1 Sep 2022 16:22:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CC6898000D for ; Thu, 1 Sep 2022 16:22:47 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A90601C6149 for ; Thu, 1 Sep 2022 20:22:47 +0000 (UTC) X-FDA: 79864639974.03.E3B6201 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf02.hostedemail.com (Postfix) with ESMTP id 145188005C for ; Thu, 1 Sep 2022 20:22:46 +0000 (UTC) Date: Thu, 1 Sep 2022 16:22:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662063765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=u0xu3/NRVBHMhSOs7YUmMQgOzAyvEoInn8uAGnxdBnc=; b=xsaNXg6ClTkia3N9XCApr+T7hOmEHqYeNBrhO//DyKKITB0Sngf4P/jvqL8CgjwQv0M9Rq ndURvyCQWXs3/iC9U9ZC29K0mosMU2lpgpleibzMM4+pr7N8WSZotbR5e8/06HczYiTuCm 6zXrCs3c9F0nNmxW0qkBQKzpHYL8R48= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, paulmck@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, kernel-team@android.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH RESEND 03/28] mm: introduce __find_vma to be used without mmap_lock protection Message-ID: <20220901202239.tnnzlbermiyvkmih@moria.home.lan> References: <20220901173516.702122-1-surenb@google.com> <20220901173516.702122-4-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220901173516.702122-4-surenb@google.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662063767; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=u0xu3/NRVBHMhSOs7YUmMQgOzAyvEoInn8uAGnxdBnc=; b=BMCnUq644M8XRZLA8twfDNUoRznKqyJfA7FuEFT7mLUF1PzH3W/tt+zOcguvXppRlRn06T 924yKkiHMoOnWjP9DBGlk1Zg1AtonHP9NCFfAii57MT9PWGEoK8+JsTiAB2HG3fOIT+/w5 3edfV7LFPj2cHbV2FRB8hgZPn9z7kmg= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=xsaNXg6C; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of kent.overstreet@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662063767; a=rsa-sha256; cv=none; b=nDr/a3XHRuGWtN6NDA3aGTjRpiUU2biEtMVkBfEwWuULuZkiGH1Rb7Kd1nWGICEIFl6i52 yEreAODBHyUFLQW8DyrT66/q6gxYaxoifHYaEuxowtlKwXjiuoXpOAbYDjr85kOgutvfI1 BXh5mincV3aNl8yhy/vGv0hpoRLIJXQ= Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=xsaNXg6C; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of kent.overstreet@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev X-Rspamd-Queue-Id: 145188005C X-Stat-Signature: 83b346uouwgoyr1bnykbefkyifuzwmu7 X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1662063766-310807 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 Thu, Sep 01, 2022 at 10:34:51AM -0700, Suren Baghdasaryan wrote: > Add __find_vma function to be used for VMA lookup under rcu protection. So it was news to me that the rb tree code can be used for lockless lookups - not having looked at lib/rbtree.c in over 10 years :) - I still think it should be mentioned in the commit message that that's what you're doing and why it's safe, because it's not exactly common knowledge and lockless stuff deserves extra scrutiny. Probably worth a comment, too. Reviewed-by: Kent Overstreet