Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1298039rwd; Sat, 27 May 2023 15:01:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64SSHLLtju9CgvzSGiPCmYw5xnU/Bv08nseSb2tLuSpBqGqiL40bsCd1y+ZtNrMO78L8P2 X-Received: by 2002:a05:6a00:2e98:b0:64d:2c58:f86f with SMTP id fd24-20020a056a002e9800b0064d2c58f86fmr9751216pfb.0.1685224911613; Sat, 27 May 2023 15:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685224911; cv=none; d=google.com; s=arc-20160816; b=CssoXomYRM8CI59AIcdKOUlgLeIrluzEfs5aXOH1S96hdFyWDq0H4+JiPmJCXPexBx hNzMXQHUHTVZp+St2vPOXLNkKdpbNaZ47/sbAxA7snQnrMNt/vf4doXpkl9CWyiChbCc +xf3iP52hdgSHoJOZBNgPb+f/tyjy538E9i3qTHLkWqRTKA4hYTBcF49cEiUl9kRmkqP zVb1eAjTOFg2TOnt9no+SzSCjn3pGIx/M1KULnbLk5sI4ew5NjylhKKg5IazziOrOJ76 beKzBbM/uysk5RU5g3ge/xHrHzRbbk7X1GU23apQ3xHq5AOMLq6oYVCGGtc9mIb2Dm6C PPOQ== 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=HTsVdUYETUvQYhUsw1vPQ/A3pGTfainUln+I/qbbldc=; b=ewFBT9WB/+ofMax9FZTszLFn42YePnCe63jxJn6uM9iT4Wzc75DXK6BR4bPf5MO9fL 6AU3p7XCWiWpQiD1yaF1OsT4L5+feIr+X9fPoaIjBf+YOoa3zCLGhW9+Yvwe0pNg0y+B L1l6ZVHs4Xva7uWR/RK+74F+wGnZ1GCWun0ART3x4AdhjIowpJT22AnTggcTR+nniDi0 ypwIad4nuwU+GrluqLqblND6DDzbPr6A9QzTHDa1SDrPXqNQQchFgsXhEsLQVUTmAqaF rOjQQ3w7ZH6+4VNEN3v01As/89t1r15ZTji+ZJGeSx0LyD3XTNHRlG5sJaPQwpeMDGHL 4dew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CQgaY0bm; 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 16-20020a621710000000b0064d2c624630si3605952pfx.23.2023.05.27.15.01.32; Sat, 27 May 2023 15:01:51 -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=CQgaY0bm; 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 S229486AbjE0Vu3 (ORCPT + 99 others); Sat, 27 May 2023 17:50:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjE0Vu2 (ORCPT ); Sat, 27 May 2023 17:50:28 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C79D6E1 for ; Sat, 27 May 2023 14:50:26 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f6e1394060so13138975e9.3 for ; Sat, 27 May 2023 14:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685224225; x=1687816225; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=HTsVdUYETUvQYhUsw1vPQ/A3pGTfainUln+I/qbbldc=; b=CQgaY0bmsaNbweVhEC0EK6GXufe06allmuKFEgeGlfGP9QY+P6tncaRLlow9wr+dJm Mx+iiysTQEZnoWlNMRz8e5xU2nCLr0d3HfcGL+HtuRCabqOOtFALGjticDrsVQQrD+0y +0lySbjFg+qZmklNrU+6HS6Sg4UOu9DIgyoTAX+NRrQ+Wrb++UfBGrMeyb4JGsu6uAd9 zwuKp4uT3YUh4Jjque+4SRcMj9WhJCQlVPpODZbNZhRW38+/28OUVW3sWLSnWeHJ22jk zN96CH7Z6W1C5DdBb9hM2HpZRWkORsdGHGmLxICUk00a1Up7mAXkAc+K3rcU94B4EXdQ W9fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685224225; x=1687816225; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HTsVdUYETUvQYhUsw1vPQ/A3pGTfainUln+I/qbbldc=; b=G2A8/9IdDi2wwV27KUy1pYSuaIHl09xWnIcS2XcIQ6Qu9aWi7koNK6E27SuXBL0Lqu 8nWVd0YAqNpramwiSwgP9Zywxq+FrAMPZaTJgxysdr0fkei3HzRGNUNoaTHhfAMEQEDz mgKBsN4akVbSKU7hw9AdU+4ePJXQ6v6La+06UHJJbboO2lHrswhpv3z1fpmByU2PIWy+ 7Mxta0QI158pmazqJh4qDCb5XKgosLyyJL89Jvi+UJOeRPkten5H5fcm1SiRHq7xNbXp 0ilacS97j8XLrUpUD0WEwLdZWZ8MEyVicCUlxMSa19IERcVFy2/aMi/O8Jy2n9AcUHw5 IzvA== X-Gm-Message-State: AC+VfDyrEoVaOFmpS36Zwd3cmuQil3iLn6T0wFTQF63sA+yj379Awu5A zSBx3vw/VPZsFshIJsI1Kps= X-Received: by 2002:a7b:cd8e:0:b0:3f6:113a:2023 with SMTP id y14-20020a7bcd8e000000b003f6113a2023mr5496015wmj.12.1685224224699; Sat, 27 May 2023 14:50:24 -0700 (PDT) Received: from localhost (host81-154-179-160.range81-154.btcentralplus.com. [81.154.179.160]) by smtp.gmail.com with ESMTPSA id r8-20020adfdc88000000b003077f3dfcc8sm8977794wrj.32.2023.05.27.14.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 May 2023 14:50:23 -0700 (PDT) Date: Sat, 27 May 2023 22:50:22 +0100 From: Lorenzo Stoakes To: "Uladzislau Rezki (Sony)" Cc: linux-mm@kvack.org, Andrew Morton , LKML , Baoquan He , Christoph Hellwig , Matthew Wilcox , "Liam R . Howlett" , Dave Chinner , "Paul E . McKenney" , Joel Fernandes , Oleksiy Avramchenko Subject: Re: [PATCH 2/9] mm: vmalloc: Rename adjust_va_to_fit_type() function Message-ID: <7afd7647-15c2-4398-89a6-ed50b4115b84@lucifer.local> References: <20230522110849.2921-1-urezki@gmail.com> <20230522110849.2921-3-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230522110849.2921-3-urezki@gmail.com> 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,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 01:08:42PM +0200, Uladzislau Rezki (Sony) wrote: > This patch renames the adjust_va_to_fit_type() function > to a shorter variant and more expressive. A new name is > va_clip(). > > There is no a functional change as a result of this patch. Small nit - I think:- 'This patch renames the adjust_va_to_fit_type() function to va_clip() which is shorter and more expressive.' Reads better here. > > Signed-off-by: Uladzislau Rezki (Sony) > --- > mm/vmalloc.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 409285b68a67..5f900efec6a9 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -1383,9 +1383,9 @@ classify_va_fit_type(struct vmap_area *va, > } > > static __always_inline int > -adjust_va_to_fit_type(struct rb_root *root, struct list_head *head, > - struct vmap_area *va, unsigned long nva_start_addr, > - unsigned long size) > +va_clip(struct rb_root *root, struct list_head *head, > + struct vmap_area *va, unsigned long nva_start_addr, > + unsigned long size) > { > struct vmap_area *lva = NULL; > enum fit_type type = classify_va_fit_type(va, nva_start_addr, size); > @@ -1501,7 +1501,7 @@ va_alloc(struct vmap_area *va, > return vend; > > /* Update the free vmap_area. */ > - ret = adjust_va_to_fit_type(root, head, va, nva_start_addr, size); > + ret = va_clip(root, head, va, nva_start_addr, size); > if (WARN_ON_ONCE(ret)) > return vend; > > @@ -3979,9 +3979,8 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, > /* It is a BUG(), but trigger recovery instead. */ > goto recovery; > > - ret = adjust_va_to_fit_type(&free_vmap_area_root, > - &free_vmap_area_list, > - va, start, size); > + ret = va_clip(&free_vmap_area_root, > + &free_vmap_area_list, va, start, size); > if (WARN_ON_ONCE(unlikely(ret))) > /* It is a BUG(), but trigger recovery instead. */ > goto recovery; > -- > 2.30.2 > Otherwise, Reviewed-by: Lorenzo Stoakes