From patchwork Tue Sep 24 12:39:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13810894 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 CAF71CF9C6F for ; Tue, 24 Sep 2024 12:41:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C58F6B0089; Tue, 24 Sep 2024 08:41:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 474E46B008A; Tue, 24 Sep 2024 08:41:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 363186B008C; Tue, 24 Sep 2024 08:41:39 -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 1EAF56B0089 for ; Tue, 24 Sep 2024 08:41:39 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B3A4541A3F for ; Tue, 24 Sep 2024 12:41:38 +0000 (UTC) X-FDA: 82599593076.15.262B02E Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by imf29.hostedemail.com (Postfix) with ESMTP id E2C52120013 for ; Tue, 24 Sep 2024 12:41:36 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bF19gRQo; spf=pass (imf29.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.51 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=1727181661; 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:references:dkim-signature; bh=OSwdqu1wcJJrzxs8LXn+s8K32MYJ6h6aFcm7CPfvW/g=; b=0m89nYD6peRJaSumo+1IYfBURLW6PyAu2IY0vWe2Mn7rd6A0mZpn1dclrEFEkPK1VHIlZX VMa65K2suOHa5gLRA2ok+MqHbf35ab/R0DRGzGH5FOnZPbJ+w0JIAdFa5ZkgsXUiEK1G5T 5ysfZERQaO273aUYvD+EuVg3keDSRO8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bF19gRQo; spf=pass (imf29.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.51 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=1727181661; a=rsa-sha256; cv=none; b=qeFafzhnCpLC7mSyf4xnVy4+OKcci3kCvljDD7OUDvVc8zqTOAohVqFC1eup/IjWXX0ig4 DeXI5T9BrXhKX+FNzY81u4QOo22gBZk+/GX63wQjKFgiGcTXnRW0qjn97WJm2VRI2HdHdS 1tlyy7HOViEQS1r45dNhY2yYnEjvrr8= Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-535be093a43so6721247e87.3 for ; Tue, 24 Sep 2024 05:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727181695; x=1727786495; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OSwdqu1wcJJrzxs8LXn+s8K32MYJ6h6aFcm7CPfvW/g=; b=bF19gRQotqy9UpcpIGdgCvMHcjirwUd8sJ2sT4VU1XBaH1GBzQ/u+mOqUHLwJ0tCJA 2D+2gWwxlN6xUhoykaFEknvo7iNHaZD1PqJqJkksgWQmk7LC9xNffTHO2qUK18BIjwdA alV7Vbl3iBSJS4IZd29EREGnE8asgxBBXSS2vWgggPIVJ/cX7d3d7eonMPzh+Pu9kd44 20FmsIRR8Ctw6GHt5qDWxu++P0yPGlq2NDV1aHyNF/w6nMAgVmGiOTj7KeGvEStumrU8 4OIVyMXGFubDIp+b4dzb5IziskP0ITw3bFAyVrW4Jdb9Q9CbgN2Y4Vqv8MsX+DwGS7fX /QQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727181695; x=1727786495; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OSwdqu1wcJJrzxs8LXn+s8K32MYJ6h6aFcm7CPfvW/g=; b=V3YS3ooN065319ypM+vwg9/JcaqXc2enUYlDmF8XRWmpdJOmadHJ4V0cw1NxoiqGLS cDgl+GdXMVQrlnaKSvHiOR8Ru9E/YMCz+xQcxK7e8QcFAX5u71GZH741+HjkAmx7s7lm n+UhD7aWZtlViYm8AC2QW4+e8/f002JKaY0RF5EFsCMJvYHuDpUiB4B7g//66whIUawd A2E10ldMJYGplWs3fqQS17GvyyJy29p9r/IGIPQrOn6TEPTkc5P3pk/wRaO3ZbEf7sPV wmVnKNEhnK4SN0uq7GwHS8juba94T5IAqTUGzyTOh/EGlDKzQnp+Ke4uRyZCeyvMdZDC eQqg== X-Forwarded-Encrypted: i=1; AJvYcCUbZn1rlEAiw6pXrmuOVnmDzdZeYxIVHC2QXzoO6gZpU6OvqnXOSxZ8ZdHlWVA1n5ybSOpVQhtuQw==@kvack.org X-Gm-Message-State: AOJu0YxHLefwUsV1np8JWLCRyJut0VxyAGXWUIz8jY4UCDJaex04XJGM 671Xk3zpOikKLGG4MLSJkbxACXE6ITBi/lmsT/0f7UpwgFFRU3Gj X-Google-Smtp-Source: AGHT+IG9Ry0lWo4YAlhJSVbINpCICVmtNw6n675YWZlhdJj0KxO9lQCk28kCdIeELjmGSx1fBQFsrg== X-Received: by 2002:a05:6512:10cf:b0:533:40dc:823e with SMTP id 2adb3069b0e04-536ac3201bcmr8493762e87.48.1727181694701; Tue, 24 Sep 2024 05:41:34 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93930f79c3sm80797466b.176.2024.09.24.05.41.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Sep 2024 05:41:34 -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 Subject: [PATCH 0/4] cleanup maple_alloc related functions Date: Tue, 24 Sep 2024 12:39:50 +0000 Message-Id: <20240924123954.18933-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspam-User: X-Stat-Signature: gn36u1t8rt38f5x6qwgu1put9mub1qt7 X-Rspamd-Queue-Id: E2C52120013 X-Rspamd-Server: rspam11 X-HE-Tag: 1727181696-238916 X-HE-Meta: U2FsdGVkX1+BwMDQJ4iOV7vdtNZLntvjbbwsgabczA/UaBso51rI8woD5i8pZ40WkV68raREBJS+/a7PjwRcjcBcJgZv8KjrMsw0EXy365IU8B7gqUNuKu4y1ek4UdsSHL7Oq8qYcdi4ROvjj73oYbiY6g9VIwzYPja52IT5UCqpxHrZZLz4E9fl+r9BPid9tMp2uWw8a4nkGxKWW0IMt/TFjUPs0QANbHVMRzIzTZR5o6oeMnTanT7x6tV6lThIZrN/EYYfBt2J8wVXWfmz2UtxcN2W81FDixpUGfZcM7/XdN3/LFKT50zK7rZ2+NuocugwOgqj+aDWv2Vfot/CglqYZ+80mjSoENdIiE8MHaRn3viatLDYIC45liLGp7BP7TJAI1OWDqUZ9GLtcVox+sVcFT63/8sQjHbcy5dq4rZv5SVTG7ZdybKwt94VUH7+lY0lPhZeWoUZ9Aru8KOvkKm6+QUNz0HlFkGdlwNOGhC7DkEzRXYjDwoF7mlAuDL8vwILjPsYU4r7wa88DXFkmvXZYnswzthEzn0Xx0VQVfhZw8wFOSvEqweIKdckQhq36pUMMYHHENT3EpHDDb4oN16lwD+nEYlvcPos1NR40CbTNmdWgImG/ri+I+uG/Mxaf2h3hJn7zQ99jb8vGBUqZgIYuleyW/FFbsk7b/5BErzYm4XqJN8M/ozKIreiKFPR1Pw8vH6S3CbLxHl5eeeXrEAhywkzMM+iLE/zsX6ZtCV9IXOgdlj+LUhfisV7uNJLonsN5MwLnMOX1CC1ZkC4N4MSoLqiRycrvQu6ZeTEyYX9ItNSmFB+ii6am3pukfv9doVQbDkcWzkYONn4IMxB7lwoPG/q7896Z1GwhlJSKwVJ6Ul3pwCe0KTpYs6jL8X5mRcE0WTRO1vIB0DSJXrL6cjJFsGiSarXqaL+CaUNUUbfy5ffQ8mBz3RQ9JO/f/zq14/fzHIraG9fwrjOl+c kcPAn+T3 NUGhiGwKSOEJsM6An7lnGfd5UTvl4FivSdXCWbDjaboCDug8Fi78s0N1CK/vtcAMacoZsW1yHA3KjJ106F3OcIvINbPh7SFzsLsOVdmJotOG9KqzLCL/4k1KTeeYs89MGzis/T1fLERVx5ia5L2RCMxNG4pIng80JQdi/Dwrx+m/2lsvHTr5d87sDK3c006Axq+q64N5tQ3fcVvLiwixdXP0iKiJeg8OFBtnP3v94ufqFESOc+0J2ywv1SOdZqs3H83Mywebb2brlfgUAZf8ONd3EyrVgsZSquZD+sUUF0MHXmYSDPpYOjpB9fa68AHDByKP0Q5puIajdoQIXXpZHK4XUX7l/SqXX+XBG9gd31Fk4cSG8M2tBOZDsk92+q9/mMqafHRcXS+zVUfGCh7cl63j6FjL1pAuOjzWzDpHrlupmaZGK3f41Z2Nw+A47IsOcCSq8jc/RHoPb7FI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000034, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Patch 1/2: some fields of the maple_alloc is not necessary to change, so we can skip some operations Patch 3: a valid alloc check could be hide in current code, so we don't need to do a separate check Patch 4: found on rare case where allocation would fail even has enough memory Wei Yang (4): maple_tree: clear request_count for new allocated one maple_tree: total is not changed for nomem_one case maple_tree: simplify mas_push_node() maple_tree: fix potential allocation failure even has memory lib/maple_tree.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)