From patchwork Mon May 22 11:08:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13250142 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05817C77B73 for ; Mon, 22 May 2023 11:08:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F18DD280003; Mon, 22 May 2023 07:08:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EFA08280004; Mon, 22 May 2023 07:08:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD275280003; Mon, 22 May 2023 07:08:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B95A5280002 for ; Mon, 22 May 2023 07:08:57 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0DB38140D20 for ; Mon, 22 May 2023 11:08:57 +0000 (UTC) X-FDA: 80817618714.15.E1E3E6B Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf20.hostedemail.com (Postfix) with ESMTP id F38F51C001A for ; Mon, 22 May 2023 11:08:54 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=UI0Yt0lW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=urezki@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684753735; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AqE7n0km0cT3SoKgXn9+9ffSGk68u7ZexKpVeyjeuP0=; b=T4ei+JsQJ+0Tx+OC9WymVuvPgEn2G21AHsPn0bLVyajHH/x9N6Cytbphu2DqphlOoWBNvb D7+54vdSViOXRTjUqLqS1ZxsD39/Wpn6TZ4adpS+r9Ggp+6EZSC4HEz9JMb27U5/Q4uK6Y ZBH14BaL2Ho77aPf549nZvjAVoMlHPY= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=UI0Yt0lW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=urezki@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684753735; a=rsa-sha256; cv=none; b=gwtudwNbF8aUkijzooOFycE8A2konx8XgvvMhOBR+BMIeMUGwO8gT4LZ2PD69l0tFa/e9s 5/nU75DAAfNFdEg9QyN2QAbVXazukzdNLbC7PxyQWdYMJuCn/a16WcDth5Bo0MW8nrPruq txNoHFKC4mO1WKUjUeuvcEc0AXHYBW0= Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-96f0678de80so1097955366b.3 for ; Mon, 22 May 2023 04:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684753733; x=1687345733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AqE7n0km0cT3SoKgXn9+9ffSGk68u7ZexKpVeyjeuP0=; b=UI0Yt0lWDXh9ljMMkPAajAGV57h0505ib1ttO6nC+S6/ox2EoI9VGZd7+i0KyUT3Iz UrOeQv6HeCqlYMLmrO9xLceNit+eAAhp+ayorSX9GWMqWetCfy65fNLgsBYIBMUhhJ2L U75zeNwLejw8wEtPfmFV0nYxaTwgfXdcMVWerdFeHWF2BfssxPxEikaABdcefX8aVmFB OzcafrJAiZhR3U1i8vQurAWGDU7VgmaPUGDQ2nyXctKGB+RLSHtg6lFIAG/yBViPwShe HnTgtWcZBRbZXXW3R63z1IHpNcsR0E7wzcXRYrATiECZ/KAKp4PAjxmjbmz2ChABim6V aqqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684753733; x=1687345733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AqE7n0km0cT3SoKgXn9+9ffSGk68u7ZexKpVeyjeuP0=; b=E2W0Gtl23cvqtsGDAeMhkFbeIOvpf31lKeZQdCLVrSVhIuwId9FDPQngH1JQUxaf3T F6yWttW+69eAJWdR2ugwsMFbYqGmorXzznOJY9KS3awBUMiBIBLdhx/YTkqF+Frc3HEB a06/VWIvw564f8SWhsBr3y0GdxnQbkju+anVMt5jTRrVJEGdDpUs3jaUlc9k2m8VseQh nX59kNJml+Bsn3ckbrpedjDkChUkqqC6WeajZvpr1321uexuBSw9Z+Yu5j4SregdoujG 7eAt1iJfzFJzEbyxvDAJpOQPxBUtXpPvJlMiOq+onS3nPBc0MVnfJDLMbH9npm6J3bQv jfCQ== X-Gm-Message-State: AC+VfDzqzw4yNaWoqKE0V3ah73KvxxfY/n/YWun1LndNVtLR2EvJQqC5 J08QF8+p3VL5cP6q3/TMuPEJ0IjI927/PA== X-Google-Smtp-Source: ACHHUZ6msUCypNMoSNhIQMunC9pTKnBPX5E3jFgX9C4tJ4LV2wmznUsQq48JjiudHWKxzuBo6hrzCQ== X-Received: by 2002:a17:907:2d23:b0:96a:928c:d382 with SMTP id gs35-20020a1709072d2300b0096a928cd382mr10346599ejc.48.1684753733572; Mon, 22 May 2023 04:08:53 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id lx19-20020a170906af1300b0094f07545d40sm2949453ejb.220.2023.05.22.04.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 04:08:53 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: linux-mm@kvack.org, Andrew Morton Cc: LKML , Baoquan He , Lorenzo Stoakes , Christoph Hellwig , Matthew Wilcox , "Liam R . Howlett" , Dave Chinner , "Paul E . McKenney" , Joel Fernandes , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 2/9] mm: vmalloc: Rename adjust_va_to_fit_type() function Date: Mon, 22 May 2023 13:08:42 +0200 Message-Id: <20230522110849.2921-3-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230522110849.2921-1-urezki@gmail.com> References: <20230522110849.2921-1-urezki@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: F38F51C001A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 14zf8egr3jnfa5k55uetcrqta5nf7za8 X-HE-Tag: 1684753734-350743 X-HE-Meta: U2FsdGVkX19A6JgoZQNOquF3OV7I2K6P/VJkgEWeSE6rgUBL7Obfic8kWZSAwdkengM/ShWWA8tD/iKrM9AlPZJDUmFsmh1TM44b8fUysgCQWVaX7++0JWxGOIpEALOvDakkeVQHNZKbQEszV/LA6zBgKkbY+mTP7T3DodQVS+hpETDx0knZmVffnU8Ylfpfk4KH34HFoezhmPDMCSqmAQL/Sxeg/v/3JfWjGTOlnuwjxBquemgXvo1Sd0+tUeJpAFkqOAw/hnXtFe8kZQyHIaxhcLi88jj+iylfwb35Q5pqD6DgObIscL1K3hjeQ7YtZF6MgPf2IEphP8VpmPRfVLNftVKN0oUNpcu0Xzy5Cjcxp97q0Mn3sLJhRzR+A0S2FfLBPcMxTBQxZ5V2naLYvvpBsX5wp0Ovd8FY9Il4uhCmB36wRAl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.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig Reviewed-by: Lorenzo Stoakes --- 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;