Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp155960rdb; Mon, 22 Jan 2024 15:40:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2v+VH3Onpp7ROdGRgtuIytmC16aJKunNfBNwbj3SvpxuGwckBEoP99TYzYECoHz/ZwGh9 X-Received: by 2002:a05:6871:a6ac:b0:214:65cc:458d with SMTP id wh44-20020a056871a6ac00b0021465cc458dmr696460oab.83.1705966844060; Mon, 22 Jan 2024 15:40:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705966844; cv=pass; d=google.com; s=arc-20160816; b=JWC9BlOOOpjA6KJod/Q1JplNbmxjYbbnRh2boVCCHQHtGKLbNsq8uOYd1xK1ERA902 skm8YEhC1I+gCnyXFfICDHfNqtUzfQtmQpQi8kuvrq2hRZZQvFVWNHu1KAgBsV/Zdro8 vH3O1vSTV2QoNrsrinR2Pd7SFF81aqwn36SfBSPRSLLwS4XRXxcWZDj62f6i44tBltSQ KVmU/AHIBtQm3TuB4EK3pf4oSEUp5a3griMRsxPd2a1SmQ4LtNEvMISIlTl5VRuTZxm2 MR50DCcSuvFaEP8ttMlhQOuUMj3q3fCmO6jtLXB9ao/D49CiPvCeCJzCQtfV4tkphmwi SerA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=758p9dvwgphmgDQjXvCaf/r5gl7Wa4re+ezrNtGjgIA=; fh=XHQpwvlFlqVAXtC8Vcb2lGq21jw8EM0gybuYjDbm7vQ=; b=fUNgLETkB1OXuE8tPE9t9EEyQSwmMDATBuR+um7kZrqUEa9Ad/vmj60wwFDuc9Ot1k 5cyIOL6q3v85ESzS/YheRkcVv/fA/pnQu6DqJzOdrxY7mfg6M3wvjcFJwta/Z0PmKjma QK7SdfG9uO1VQ9ADa42hdcMiCBQMX31VZdD7qnQRt7Pmr+5lKkiPrjOl03LoiqyqJd/U PCFgzLyGHm3NKbN+73WOg44QIbkPeSo9hMZgG8C8DndN9qYWkz/578K870J/KIYowe/D OhK5PQcwI6SgTZ5UhFFWxNDKtxC8DGosyMjZEHWjVbQP5L+784K+thO7ffS4wcQtJSk8 ryUw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="nAr8c/6t"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-34301-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34301-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b18-20020a63eb52000000b005cecc2f4132si8818027pgk.69.2024.01.22.15.40.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 15:40:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34301-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="nAr8c/6t"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-34301-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34301-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AC5BD28B3B2 for ; Mon, 22 Jan 2024 23:40:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 744864E1AE; Mon, 22 Jan 2024 23:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="nAr8c/6t" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BDD34B5A6 for ; Mon, 22 Jan 2024 23:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705966836; cv=none; b=Q7HP90B1XQtqYYfjfj6uT6uWvkcT1Iw78uAPrA8hIj98l7O9dfbqYpjnuRTYwBqdMK1fFBdIFfOQ3a+fujaObBipGnfIBeCi4rzIHzJvsM9JwWaT+DSwAvJWPP92Jt66QVn/wsPrrc7E4sP/I1+Yvpy0Mz3u8iKdLrjuXmr4/eQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705966836; c=relaxed/simple; bh=0UEy2va11olg9s5mtm+VeIjV/EWP3UBwsC93Xz1hgKA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=aVlvtv3BvgzXr1XPHP+3YpcuLFGSJT7hqiuG2px+76DsB5xdIRJThthHnk5gdJovA1MmbYGRz1ATRhmW4bmy2DLg6EveRHewzleZDgdQn/tsRjQ38CcyQ3tKvVTg7fVqyZHsoBcS3Wx5K1XBYxz38ylNfkTeXiPNEYv+MbLrjjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=nAr8c/6t; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CB2BC43390; Mon, 22 Jan 2024 23:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1705966835; bh=0UEy2va11olg9s5mtm+VeIjV/EWP3UBwsC93Xz1hgKA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nAr8c/6tRK+JsCr5vqpn2a/5cp6X59mrnA4Q7GQ2BB/eS3wT8ihgSZGGOS01OA1dv ZtctHjbIEinh69W5JaSlIXMdgeP71/FkwrU8jfGICW0ebU8kddHHxlb56UM+fQWxat 0MSNT49MYgUAm4MSQZMGxwkgITXsArxZFb9e3Pqg= Date: Mon, 22 Jan 2024 15:40:31 -0800 From: Andrew Morton To: "Liam R. Howlett" Cc: Yajun Deng , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/mmap: introduce vma_range_init() Message-Id: <20240122154031.b710f834b14d9027176f439a@linux-foundation.org> In-Reply-To: <20240122220031.pwiravglee7o7k34@revolver> References: <20240111021526.3461825-1-yajun.deng@linux.dev> <20240122220031.pwiravglee7o7k34@revolver> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 22 Jan 2024 17:00:31 -0500 "Liam R. Howlett" wrote: > * Yajun Deng [240110 21:15]: > > There is a lot of code needs to set the range of vma, introduce > > vma_range_init() to initialize the range of vma. > > > > Signed-off-by: Yajun Deng > > --- > > include/linux/mm.h | 9 +++++++++ > > mm/mmap.c | 29 +++++++---------------------- > > 2 files changed, 16 insertions(+), 22 deletions(-) > > This isn't a whole lot of code, are there others? We're losing code > clarity in favour of saving 6 lines? > Oh. I thought it was a nice cleanup which made things more clear. > > diff --git a/include/linux/mm.h b/include/linux/mm.h > > index f5a97dec5169..abb4534be3cc 100644 > > --- a/include/linux/mm.h > > +++ b/include/linux/mm.h > > @@ -3516,6 +3516,15 @@ static inline bool range_in_vma(struct vm_area_struct *vma, > > return (vma && vma->vm_start <= start && end <= vma->vm_end); > > } > > > > +static inline void vma_range_init(struct vm_area_struct *vma, > > Any reason this can't be in mm/internal.h ? That would be good. > vma_range_set(), vma_set_range(), or just vma_range() might be a better > name? My thinking is that some of these are actually modifying the vma > and not just initializing it, right? I'd vote for vma_set_range().