Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4099169rwd; Tue, 23 May 2023 03:07:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yIYRM1eL29GRhymX5JM0A6l+NbnvZdRzzuSOoW9VFljmdKU58QAiBQCZUZaenkDYJru4u X-Received: by 2002:a17:902:748c:b0:1a9:21bc:65f8 with SMTP id h12-20020a170902748c00b001a921bc65f8mr12531921pll.11.1684836477109; Tue, 23 May 2023 03:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684836477; cv=none; d=google.com; s=arc-20160816; b=iwQ2+2WLx9S+JffPZ+VQHzD3QMtG6P2ONbXslDoTtl+kWRNSEykH56a7GOfC8q2vSm 40ZkrBEG6sNjGsH3R0yP2sSJ2HJgcLXwr+QpTcDsmHwv10R/4dOTQPJTZXjkGSRrP7Li TPUFtZGWom1LMbVfbZPSoys4TUhMwTSgL/oKlprC8U8kZzUUcpApS9Q3UD3rXJDt2QiB pJKLnZwUkwCXFbIex2PPCt51ARKiHrBGh3u03daWJF0fS96vsqcrkFeVemQegU7sdx4O +1VAhfdLZ2f6wnRMUPufu6twaM2cARA3Iv0GxkM9IVupcuGYrVnnSvS4Uo8mqLdkevQa fSaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=edwWrDcvxwOBnRngZUhvK+9rBRKB1nAa+UUBR0uzu3Q=; b=om8xddg6lCSImZfOsFHG6+SiXAyunH5O4eM7ylX7rkSntHI/Jn9v+wTItTlJhUoeff MywD0EthSVqgP2TfrT556RW0uyHtprmxhuz5xpZzHxRmZEfqZ8AzD99v+CRELiU2vc3p D7Dad1XPVOiHVQiwhEgCqr0dSsOuMA10kWLTu7X6cNUQfhEsqUH5+LVnmj01QGz4zfib cVyqceCY5IDrDCaULuM+b/Z0pZi2PpqnE2FVaZVe1e+WXFbagipH7E/MC5D6OPzQrttU EBztStO7C17CCsAlzKKQrPlhD/NDBMWynl1p5FB/YypC6jMDHZdwE6tLHLuu74OHChW4 s5MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RUgvWVxB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170902e88a00b001a9930c626dsi6721543plg.273.2023.05.23.03.07.42; Tue, 23 May 2023 03:07:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RUgvWVxB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236430AbjEWJ6h (ORCPT + 99 others); Tue, 23 May 2023 05:58:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236342AbjEWJ63 (ORCPT ); Tue, 23 May 2023 05:58:29 -0400 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ACA213E for ; Tue, 23 May 2023 02:58:23 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2af7081c9ebso29717231fa.1 for ; Tue, 23 May 2023 02:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684835842; x=1687427842; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=edwWrDcvxwOBnRngZUhvK+9rBRKB1nAa+UUBR0uzu3Q=; b=RUgvWVxBrN/R6ZuIQbV6wY8ghqqsoVxOK0JTpAYxXpoNZiGgFhP01/NEKe47sBpe8w IMk2y67i1dKZKXfjOSdxtgXfFCdzajrk/ppKMiW3F+3jXU0sNKZECycLCQeDMdBTkKtU XEz8JZ3cad2qCmXkN7B4RDvWuvjQEXj3mXRBB1B3CIDvpDLeZyoaiooHdOZ/lJtPCLWt 7enhUv2Bmxep08dWEWyAIQ/8Q74408iFJ0k53/lra5+kpG3toVn9zbfXn8HggYq/GUPL 1/q8JTtd0UzBcCLpwZxhh38FATr1vF7ShurNLef24X6pu4vfvcYLfhgSWiquVydPs4Xm L7qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684835842; x=1687427842; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=edwWrDcvxwOBnRngZUhvK+9rBRKB1nAa+UUBR0uzu3Q=; b=A3ACpgj5nEwyXHRyIJwVKLLjk1b/3KQBoHgHUPZLzyTnCgPoPb3xAR8lxveAwo70xS JHE+BpFUtYOq+7nnLB2AYO1snQYXlOh3MduQNb3d9tOS1acbO4WZalZy7lnMUgj2BA/7 ZkimoDeZN9rrpBz3/A3L3KN8rXhILEhlRIBxn40kwZsxdL8vwGOlvZIJFxi7OAJlLI67 tkdVksuN2Z4NbG+mwyAD3cmwPX8EVXIYIFv7AUv73zqR5sVutu+O6kY7reTMpNOxcgFa O6p4ORe/qemE2QyGg+lMnKpn8FaKwWn5UXnWxZ+wytvSTGI2327L1w9rs5PrkN7PVRcd TT0g== X-Gm-Message-State: AC+VfDxQuBaOTvnfCQ7BxpS5HLZCAo9tvL8q4dDN1cx21q8wqte4solG xLyXcfDN29kWvF7vgIshdT0= X-Received: by 2002:a2e:9117:0:b0:2ad:af50:6ecb with SMTP id m23-20020a2e9117000000b002adaf506ecbmr5135063ljg.14.1684835841510; Tue, 23 May 2023 02:57:21 -0700 (PDT) Received: from pc636 (host-90-235-19-70.mobileonline.telia.com. [90.235.19.70]) by smtp.gmail.com with ESMTPSA id q16-20020a2e9150000000b002ac871d0207sm1558123ljg.88.2023.05.23.02.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 02:57:21 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Tue, 23 May 2023 11:57:17 +0200 To: Christoph Hellwig Cc: "Uladzislau Rezki (Sony)" , linux-mm@kvack.org, Andrew Morton , LKML , Baoquan He , Lorenzo Stoakes , Matthew Wilcox , "Liam R . Howlett" , Dave Chinner , "Paul E . McKenney" , Joel Fernandes , Oleksiy Avramchenko Subject: Re: [PATCH 1/9] mm: vmalloc: Add va_alloc() helper Message-ID: References: <20230522110849.2921-1-urezki@gmail.com> <20230522110849.2921-2-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 22, 2023 at 11:05:57PM -0700, Christoph Hellwig wrote: > On Mon, May 22, 2023 at 01:08:41PM +0200, Uladzislau Rezki (Sony) wrote: > > Currently __alloc_vmap_area() function contains an open codded > > logic that finds and adjusts a VA based on allocation request. > > > > Introduce a va_alloc() helper that adjusts found VA only. It > > will be used later at least in two places. > > > > There is no a functional change as a result of this patch. > > > > Signed-off-by: Uladzislau Rezki (Sony) > > --- > > mm/vmalloc.c | 41 ++++++++++++++++++++++++++++------------- > > 1 file changed, 28 insertions(+), 13 deletions(-) > > > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > > index 31ff782d368b..409285b68a67 100644 > > --- a/mm/vmalloc.c > > +++ b/mm/vmalloc.c > > @@ -1482,6 +1482,32 @@ adjust_va_to_fit_type(struct rb_root *root, struct list_head *head, > > return 0; > > } > > > > +static unsigned long > > +va_alloc(struct vmap_area *va, > > + struct rb_root *root, struct list_head *head, > > + unsigned long size, unsigned long align, > > + unsigned long vstart, unsigned long vend) > > Prototype continuations don't use a single tab indent. Either two > tabs (my preference) or after the opening brace. I.e.: > Will go with two tabs. > static unsigned long > va_alloc(struct vmap_area *va, struct rb_root *root, struct list_head *head, > unsigned long size, unsigned long align, unsigned long vstart, > unsigned long vend) > > > Otherwise looks good: > > Reviewed-by: Christoph Hellwig > Added. Appreciate you look at it! -- Uladizislau Rezki