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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD34CC7EE23 for ; Tue, 23 May 2023 06:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234841AbjEWGGQ (ORCPT ); Tue, 23 May 2023 02:06:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234893AbjEWGGK (ORCPT ); Tue, 23 May 2023 02:06:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1C51188 for ; Mon, 22 May 2023 23:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qCSqRU4a/AsmBcdv6iFySShWfg8XjHUWfeGXvA0y1bo=; b=c+Zpz1LY9LjeY59YL09M41TiAD Johlulku37xPjx21Je0nBNT4hTLy0GVlvzREcICEC9Ay0b9XMgFEpLT/5qEhgZl8WwDb07aSxxSGm XN8NCq/Qs5n8fANb+AWvcekDppF0HtwpOnJmS7epKKWKD6yPgNkKezXsSHqauzvs/rQyFEjipBqQo tJZTZ/L2EUqit8LES+1ArPDYX5c1vhlmiQUkMrO5Psk716PS/swRG3D+/N3A5RUz/jcVkilGd64Qz qkTTMvfuSJSjQ1JZrL/sq9FhHWcdoTHNWnYDEYbZumxDfJUZXRjZJfUc863GeIcpXwcamCf0PfH01 QM6pR9Nw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q1L9h-0092MO-2U; Tue, 23 May 2023 06:05:57 +0000 Date: Mon, 22 May 2023 23:05:57 -0700 From: Christoph Hellwig To: "Uladzislau Rezki (Sony)" Cc: linux-mm@kvack.org, Andrew Morton , LKML , Baoquan He , Lorenzo Stoakes , Christoph Hellwig , 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: <20230522110849.2921-2-urezki@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.: 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