From patchwork Tue Oct 15 12:07:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13836272 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 557C8CFC29A for ; Tue, 15 Oct 2024 12:08:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B59BD6B0088; Tue, 15 Oct 2024 08:08:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B0A616B008A; Tue, 15 Oct 2024 08:08:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AAF46B008C; Tue, 15 Oct 2024 08:08:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7A51E6B0088 for ; Tue, 15 Oct 2024 08:08:26 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1C67012153F for ; Tue, 15 Oct 2024 12:08:18 +0000 (UTC) X-FDA: 82675713876.07.DDE5354 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf15.hostedemail.com (Postfix) with ESMTP id EDFD2A002B for ; Tue, 15 Oct 2024 12:08:16 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=nSlcjNnj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728993999; a=rsa-sha256; cv=none; b=DvXglg3AvN1uq5StV2K+8MN0QiNOoSWuvdTRj0KGGgskE0PazRK23jEktZsWaWfkiT8ZLA cbxbgV8XWpmsv8GIK6XWxPd00ua1/vHoQ29W34w9/haCkE2+fUwok/x/otQdjiRGOwoUjV /uCuKBXIOJG/Jqq0uUZMaUfAuXXKJsk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=nSlcjNnj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728993999; 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=fxoY7C4VGYq16+sAQnODAKHP8M41ALGIoN3BFVWo/Vg=; b=n3HhvWMJRqfq4uFD+GAj77Nex7wSPJ5NQqKUS5X6aMDP6q6ZHh2W472fApygUHoMOcB33/ X4L3993njo3BYcxev38dtjRX7lNQ3MNx8eluoIwXtTPsokxyMLFPBofZwl+TS9p/4exVQ2 RlC4t+ie58X/aNHQPbwsLg4pM1Ic34Q= Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a99b1f43aceso765114466b.0 for ; Tue, 15 Oct 2024 05:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728994102; x=1729598902; 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=fxoY7C4VGYq16+sAQnODAKHP8M41ALGIoN3BFVWo/Vg=; b=nSlcjNnjDPuIbhfDNI+WUAmUvxTuoIDxsYVFgOOL6aFA9WB++6gsJMKuO5w/k2AbZv SzFWtZg5pinZAmerAyNCT7XK3UByhigSSHDKOysku9zIlkcy0HHnwNTtzi6t8BhvZNu1 FsOpTPR/e7mCrPqHWdCu0J5TFTOz6iG5NC1zaSFsxnCqToPEBopKPosAMCne9OZjY3cm JHdkGLjStR6VmrTXSc0fDYRzFTZzel/oQDrf63fWG0SSwGS0vSBflMCf50aP1jGnfXVK d55/fwqrGf42z4BLl9mIUL333ctFqp98egZhWYmjsMI6cWzTpHuE5wgF6dscepEUpMjd HVTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728994102; x=1729598902; 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=fxoY7C4VGYq16+sAQnODAKHP8M41ALGIoN3BFVWo/Vg=; b=SbTQZl+mqEqH5YnefyXur+ZZAZtp+5ijINoPa7dC9y1cs2aBUlGHUDt7Fsw68my82A cpDLJCQaUWPUwVx6rUM3hL+2vSbmMHKD5VNqow510261Zbc8gqQm7Ya+/gKLruxv/mww 8JwOkyhNDEECZx0lGOyz9ZMiwkKpvRP4Bi2VBlJe56dY7vWlb/d8EMSLc0wbcGnmSLaa ymFIniRmqp5xMVXIdmY9fPGUHDGtVFG/j1eE83PXuiiKUh8sEkRGbqInRQbfgzqtkPYP g3dd3NS3UzGHYSWkp4pFcS/c/utiDjNlgFCeW0oL6OTKzdyzA113/RVecHQwn/dWIhAh 9u5g== X-Forwarded-Encrypted: i=1; AJvYcCWp5PJJKo38I9lHeHeZ5t7O4X3GU2Y8kwW5MbmKT464Et8bFgJGsTz3joho1D4ddNtt3fn3L+D8wA==@kvack.org X-Gm-Message-State: AOJu0YwHCOFhbK0Gn+XjInKIXtjzMUEln7NYtz/NQyPessXgFkqXQVSr OqFPFzNWKh6/t+4Ba12XZ7v6gWsI69EVWSv95aF+unw7OeXjPBF5 X-Google-Smtp-Source: AGHT+IEDUsZrHeJZIcuEtncoF1MfpXbAXYhA0FlJPUDCtvdMGPhPUHPSXpLS4NnQoIJEQYjfJEoqtw== X-Received: by 2002:a17:907:1c0a:b0:a77:ab9e:9202 with SMTP id a640c23a62f3a-a9a33572723mr27345066b.4.1728994102272; Tue, 15 Oct 2024 05:08:22 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29817f60sm65039766b.140.2024.10.15.05.08.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2024 05:08:21 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v2 1/3] maple_tree: clear request_count for new allocated one Date: Tue, 15 Oct 2024 12:07:44 +0000 Message-Id: <20241015120746.15850-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241015120746.15850-1-richard.weiyang@gmail.com> References: <20241015120746.15850-1-richard.weiyang@gmail.com> X-Rspamd-Queue-Id: EDFD2A002B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: bauizrmkbkgaa5airr6p69f7a3yxh9wn X-HE-Tag: 1728994096-54487 X-HE-Meta: U2FsdGVkX18hjW54okzFJ+QveC5vJ9kQU5/1PyUf5Var25v9cqnWWZXYWm1cvrDhgWDqE+jocymkZ8620dRV8fcsIzIn7tl4xFzBUbfxTaNbIqusAKKcXa56yaz5sDx6hh5zPLaLA5Belsbbml34/oLbBhWbWUYbRm58zrEmQaJJRatodzq3jZ6kOm9a7xTy+RFdhkZvefJYTSxG71cxA/Ny+byVXYJ1cXn+PWtkUmwjH72VQTkG1sWtnFRrw/O9s52K4oqG6hu1+OKt7o0W/2wJQWiCeRlvvUxViEcTRweidHGBkzA/j+ALjz/lc/hp/ZGrzzplBJZHGzCbvSs68C/XRKTZw5lSUDZT6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YWufs1ha4j+wcr2bbclz3q/9Y5Kycx0ieINYVjkqmU4jAe+2nX9doe9Z3OsEWL/8RtQf7NbBNlbDBTGJceXMSjx5snIA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.010203, 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 this is not a new allocated one, the request_count has already been cleared in mas_set_alloc_req(). Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 6047c74c5a31..31899e853c1e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1250,11 +1250,11 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) mas->alloc = node; node->total = ++allocated; + node->request_count = 0; requested--; } node = mas->alloc; - node->request_count = 0; while (requested) { max_req = MAPLE_ALLOC_SLOTS - node->node_count; slots = (void **)&node->slot[node->node_count];