Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3882705rwd; Mon, 22 May 2023 23:08:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ763pQfg5GEJeZn9L8JXbnQ4111CEkqdmsbSh0zefX7meaUo1RcxicsI5DrKbwD36298OeA X-Received: by 2002:a05:6a20:3d0a:b0:10b:ecde:2918 with SMTP id y10-20020a056a203d0a00b0010becde2918mr4631393pzi.32.1684822087713; Mon, 22 May 2023 23:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684822087; cv=none; d=google.com; s=arc-20160816; b=V2UVlbTkhBejDetbCTRXA89QWfBiWYQh4H81Cnp137+CHUlZeUYkOWLxO1rqjm4V6K AxhDnIiLiCIlpAFPg1uxFljndLiDqc0QYDo0L+RHIsRrLMs+hXXkfbwmNRohYOFCIKLY QLmAf3FQLbOt1WkIbROQZNuT9gj2X6FooRuPZJro4UiPiOBIpLG1Qys19ngy2b/f4IkE oT8I2/5jt0ldj5rUfLawtW01up08vEqjspPLaSijQoq1GrXR1Yf0nzoWBfH45UcpKkuW ji1WG6Vz7NQFHQMZBxwf67uogfpfArKsvmcQgglQhYo10olsU5yaU0Z88oTd1/wQRAIN jSFA== 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:from:date:dkim-signature; bh=qCSqRU4a/AsmBcdv6iFySShWfg8XjHUWfeGXvA0y1bo=; b=1IdrIm3UbFUoOV4MoklcjjweAWtHmnUnwwbSxjhCHKAVkQVFk0tRWHsW0WKFjW/0aM Ix5jviKm436/A+R7nrcGJz/zRfBhELhSiGyjXAfULDoiD0Q8bjZNrCLL8xJwWMnGLarc fN3D42LRevIelmjAPASxetqy6mqHxE0ZuOWnJppgBau6BfehnO4zvmtrKMG71ZgGXVgb brfYRvyrsnTlefsRofiRZNvo0l+kfHs6nYl2mDY+QZKrpyghaafMToU5z2eYhMHohvcF y8PvrJ5ds3o/5Eu5x+w2co+Szw/7a3a/J4O8ykoAEMyS5gbXzhwLnBuXTMAht60pluIy AASw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=c+Zpz1LY; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a637354000000b0053439ea59fdsi114877pgn.19.2023.05.22.23.07.55; Mon, 22 May 2023 23:08:07 -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=@infradead.org header.s=bombadil.20210309 header.b=c+Zpz1LY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbjEWGGP (ORCPT + 99 others); Tue, 23 May 2023 02:06:15 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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