From patchwork Tue Sep 24 12:39:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13810895 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 B84E0CF9C6B for ; Tue, 24 Sep 2024 12:41:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 318C36B008A; Tue, 24 Sep 2024 08:41:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C8536B008C; Tue, 24 Sep 2024 08:41:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 190256B0092; Tue, 24 Sep 2024 08:41:40 -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 E17B96B008A for ; Tue, 24 Sep 2024 08:41:39 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A55381A112F for ; Tue, 24 Sep 2024 12:41:39 +0000 (UTC) X-FDA: 82599593118.01.9EFA240 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf11.hostedemail.com (Postfix) with ESMTP id DCBC640013 for ; Tue, 24 Sep 2024 12:41:37 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=WcsvGR6Y; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.52 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=1727181662; 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=oNxGQ+aYB9uCw8MY4JmeL6xnjWLzH1FdLZAcUc6N6U0=; b=OM0Suq6qOdiJ2WVwVsWtssVk9OLS32JZVIXqKNWa6+5P2FlZKcNqoOz08MZcXoke3Ynk65 8crvi6K/qDw/vJ0pfWXLDqcVhxRNhpPbmmKaADhaShg+2Bkw+epUUJwx67bkwcR++bySXt JGAeLTBmSjOQ30oRzKUI2eVBG3srF6g= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=WcsvGR6Y; spf=pass (imf11.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727181662; a=rsa-sha256; cv=none; b=GQ8afrUExszXVWguqn+lNBO0X+G0WpD4W9HdMaXprnskLbRRGhwo6yBwuj7lENT+2junw9 j5WCMLK1kAZ6q5yKjohHr4feTVQR9dBQDgjDxw9mSjg+GCoqx9QHI/BPahnsS9ezF3locY 5HW4yx7SA8KlNoqGuwtpckTzq5PKOYY= Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5365aa568ceso6409185e87.0 for ; Tue, 24 Sep 2024 05:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727181696; x=1727786496; 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=oNxGQ+aYB9uCw8MY4JmeL6xnjWLzH1FdLZAcUc6N6U0=; b=WcsvGR6Ydep4FVe72/un7+MS3Hao6TPCDX5voBLTBtoaCB2IY0cI76duMIIAG1PFqE /dqgzHbnjHlCZ9+F2S3iT0SgjxPWDvkxUFXoVe2EKhvDlV7wKgAWgSa42YyWn5TA3Bx8 3g4/rOY49cnDh8eMPW/6MFdM7Kft96zSag6nAenGWjyVVCxAUzi9YUuXdZ9QdkfmKYpm w3DkMy4bWTQcblLKEK/WVmkYAYO4UGD7bAYj2Et5uSGXCcJVFLnp1SD+6kbVq9oBnDzg wARjxmbGsvTw8ri2XZJFgixKywVeuU+9JG1tL1Kr8pw1gxC16IkR04OpfotRWUqJDCqH cDrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727181696; x=1727786496; 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=oNxGQ+aYB9uCw8MY4JmeL6xnjWLzH1FdLZAcUc6N6U0=; b=O6igELdyUrCSw6XLurjvWYOBXW6deDns6yodj5vGomrrM06WKQzOu6TIzn+Ka1pd8c 5xIVXBsnUgpppv3xPZk/zk5tc6JMsjoKo5WcxeA4z0sLjO7G1poj7SlgtS/KmeIdVb/O 9lB7Og7FKtg7g3NCOX7avE9shlhcON4dyYo+ZaI4QFTMeR31GaC9JdOrzjUfjNBefYHa xCzrMmWlWFquwXQ4XkRHP592pbVVc3deB/RWjjauZ8y0bGQObjuRUO18DBiFNkXvfKBR 7wUZTrjsfqYG5bRCZaeBFAc4z4cTDrQQIUYv6kH54ZwZfD2Hsqrcu2vxuvWplVGqWHJY 15lg== X-Forwarded-Encrypted: i=1; AJvYcCXz5kAmmLV5JETsO9OWiRpMq6AIcdnNEe2TMdgq6JuYFfTXG2eg6ZcnBH5ACtcnp6FHrTjHyHIdxA==@kvack.org X-Gm-Message-State: AOJu0YwHgC97CWtN6OoZNKhBvZCYhZ4lSLq9jCR2b8fOINKmCkiQBxqW vcX1r/kNqb+tCxMr2L6ZaafgRfv91xQ2bjy5WqG1znE+1b4T+fC4 X-Google-Smtp-Source: AGHT+IElonvP7Jn72Wkfz10aUqBKxkesxTOzLAO2vhcX2eYVvOsVaMsi0+sEkvgT7u0gZDTZzSGYEg== X-Received: by 2002:a05:6512:2395:b0:531:8f2f:8ae7 with SMTP id 2adb3069b0e04-536ac2f5196mr10275125e87.25.1727181695883; Tue, 24 Sep 2024 05:41:35 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9392f5466asm80151166b.76.2024.09.24.05.41.35 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Sep 2024 05:41:35 -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 1/4] maple_tree: clear request_count for new allocated one Date: Tue, 24 Sep 2024 12:39:51 +0000 Message-Id: <20240924123954.18933-2-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-Rspam-User: X-Stat-Signature: gzxhypdeu1s8qpc8ufd7ijs3rkn3jioo X-Rspamd-Queue-Id: DCBC640013 X-Rspamd-Server: rspam11 X-HE-Tag: 1727181697-287570 X-HE-Meta: U2FsdGVkX1/dgnZnnRTEzmyVPdTcT8PtF8Q7akV0x8akk5F/aId56pBI4ouq6aMNRyAS13fuA1P/JoGtPLDKRIf5GtCwcoa2bmb7NrDVvRNwE4FtvLUnY3j417eJJXWZ4eFn4XTgNsry6I+6OzYn/3XPSf6AQG0VxZwpb6BxN+FkegTgXzdTp0jYs2XHKIWncRRqdLJXhP0LQC4HKfJYlnB/EVOGvsoX2pyOOAYI2MrqaEUX+VWOy6MOCqeTuOigMlS1y+K5hYpKfsGnefqPM5Mjb+BQhgMqPI1UIzYtlB4dQmFIQn4n2eQWcBRnzfo4Uqbz1qTHJpR9RcH5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HC+Qmy79YLEsr7qHA7m/Oqhju/BEteJuc/SGXyBg4gGNeSNnwuTsgbZqRyVGvBPEvc/P0s5nbP02ux+5QLuF985882NZhA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001503, 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 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 fab1610dc800..75be2c81f0e2 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];