From patchwork Tue Sep 24 12:39:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13810896 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 04A25CF9C6F for ; Tue, 24 Sep 2024 12:41:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A92866B0092; Tue, 24 Sep 2024 08:41:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A41916B0093; Tue, 24 Sep 2024 08:41:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 895746B0095; Tue, 24 Sep 2024 08:41:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6105A6B0092 for ; Tue, 24 Sep 2024 08:41:41 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0FC1A1C6B3C for ; Tue, 24 Sep 2024 12:41:41 +0000 (UTC) X-FDA: 82599593202.09.3C49C74 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf07.hostedemail.com (Postfix) with ESMTP id 4F6F840017 for ; Tue, 24 Sep 2024 12:41:39 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ksZKYuhm; spf=pass (imf07.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727181581; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=7ukK8M8lT8M3ISBtZtHKSux3K616jUxUW6DFx49LVxk=; b=gPJ7KkL3XyND/g21YNyBLCDf+ISb6NvPnM+WXRrwWRx/lrGqKflWXYJJ0uC1xmBl65mfGL LkQDMCZW1qfXIcVK/qXJkMxkbhzBNMeVGU34ZX7TsvQW3sY9cWT6DY4HUA92iJqBTec7X8 kExGJbH+jOnoM6h5GHnzCuZfbJRELMQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727181581; a=rsa-sha256; cv=none; b=END9eeQapNyXdT4T+KdIaylONablSdeflpyLBrSWUv2Yla+MNFqeZU8ZOCa2drXUJ/Hzq6 P87CPkYmJV1C0KnPTWnGYLaPct5S21BD7KZWxbxpvZq4LgkIsw+E/YF03i2uezlXLtPBgK kSPDKutpe+YtcVuHRT8AkM86pY+3lr4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ksZKYuhm; spf=pass (imf07.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a8d51a7d6f5so822652066b.2 for ; Tue, 24 Sep 2024 05:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727181698; x=1727786498; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=7ukK8M8lT8M3ISBtZtHKSux3K616jUxUW6DFx49LVxk=; b=ksZKYuhmjxw4T9elHV8j0x+HtkgYEO7TmTZBcc1g9jmyp76nM9GnPCzb9/BpU21Ctx ugA1BQF9BSpNsXqiu0zKTCnGVeE6PUCenUTP81o73RG3RUED/N/bgCUp3q9VK+dpEGrJ +mUi0XF/iF+DhHs+L7KpVeK1JBUfMXAwDXniZin54uW3C1WclzlzrzXCG46tizOjLldX +hCRVMnGM6/14v+etJQwC6gQrWYmIFKbOFxoDqkP7pOVE8Gsnj+i8lmFH6ZAxyUOTwX0 owlNrdgaz+jSA96Cjmc59yuCaRpNZseFvrdDx10dTefCTZ/Y3qVLgZS7Lkrjdi9PD1/b hVcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727181698; x=1727786498; h=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=7ukK8M8lT8M3ISBtZtHKSux3K616jUxUW6DFx49LVxk=; b=OvpcVi8SJ8z0nipIQkwsj13kyun/eMiWhJHdr2MyAAQ+GFtMVUbifpTC6ubd8rR4Gn 6pLFUdhgOID8XX9g258aA5IgTGOy91//HLQhMM12mgWGy5cjUkAH1jJ5QWffM2xhG8er ACAbmj/e6NUMJffh62K/YAWOIQnnk/dqmGHFTsN+vdpEB1UPCtZQLBdLHAB9W5rMxpOS fg2UNY02M8xA2CmauWG04zQKLHQ/VUnjE59G5qvkGjtjuaAl8Tuxc1xKNMe9eBm9AXE5 Jym4pM8RvlfY8KESKZVesaVHp36/ZRnX8VoPmNSFuNpxqmqaLh+LdxNhlUMyfuN7Wnek Esgw== X-Forwarded-Encrypted: i=1; AJvYcCV8XQwDRS40FeGC8u/7WyF08EoHeC6GP8fjg0Dj0yqpCJV4WaMp1Yyop2TM7aCQiTaWWmaObUovIw==@kvack.org X-Gm-Message-State: AOJu0YyR1dsK5j0a+p1dH4ZmIYs7GeH9KbcdN9NEQ+Kx81aBEj8k/fy9 pOApnMy6ODmB5CLql0L7Hga2t2klV0iURD/ZwBzSs3+lK+MEvbEzzbF3xjCT X-Google-Smtp-Source: AGHT+IFACUJu2dw+Qf9lNGpIaoQCjyd2WIgKuG+GqbRuI1Gg+VeYxr/0igAOcu09yw/MQAvhIj18vQ== X-Received: by 2002:a17:907:e269:b0:a8f:f799:e7db with SMTP id a640c23a62f3a-a90d4ffd95bmr1297917866b.16.1727181697569; Tue, 24 Sep 2024 05:41:37 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93930f79ddsm79709266b.158.2024.09.24.05.41.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Sep 2024 05:41:36 -0700 (PDT) From: Wei Yang To: Liam.Howlett@oracle.com, akpm@linux-foundation.org Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar Subject: [PATCH 2/4] maple_tree: total is not changed for nomem_one case Date: Tue, 24 Sep 2024 12:39:52 +0000 Message-Id: <20240924123954.18933-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240924123954.18933-1-richard.weiyang@gmail.com> References: <20240924123954.18933-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: 4F6F840017 X-Stat-Signature: p6gihscp5dhpiw7fuq4g7rgtefaumq3b X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727181699-76632 X-HE-Meta: U2FsdGVkX19xXBcdxLQ2mAHBUj3TDr/21JPP1+D+EVuX55E8VMS1EN34cIToqMdcs2mIE3x6ajx1Ib/ogvdvv1vMbxZg8nPX4/zZAedukl1FnYfQdiCq58YlHpg/lLghni+7UA4oE3/yD4z7JL20XI9afaLim1oIdrYVtQlloeTZD0C80J+5DYSN6lF+UuoLP4in6pra9rfWiJx7dsi4mA4sX9gB5W9pStDYTjOm7vZ/JQvqhaUZelt/X2aGOAIvs0SsjXDNwiXG+P3eoKJV+28l4RnnaOLGlCK5gSfU3P4M6V963AEZdSc125i6QiPOo5C4H9xWoLkEXlSjh9UUspFmZ/u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6F7HeOCU1+rxWAVHOLUZN9TS64IVvJmhSR7B73gL/w9L95HjZLT/mL2g/Cu8YWk0HNf/XfKfeJfaIFtmO6N6qh8dYsvArXHH7ykXd7HiHB5sg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: If it jumps to nomem_one, the total allocated number is not changed. So we don't need to adjust it. For the nomem_bulk case, we know there is a valid mas->alloc. So we don't need to do the check. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar Reviewed-by: Liam R. Howlett --- lib/maple_tree.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 75be2c81f0e2..c1fb67540cc9 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1279,10 +1279,9 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) nomem_bulk: /* Clean up potential freed allocations on bulk failure */ memset(slots, 0, max_req * sizeof(unsigned long)); + mas->alloc->total = allocated; nomem_one: mas_set_alloc_req(mas, requested); - if (mas->alloc && !(((unsigned long)mas->alloc & 0x1))) - mas->alloc->total = allocated; mas_set_err(mas, -ENOMEM); }