From patchwork Sun Sep 8 14:05:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13795493 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 AE21ACD4F4C for ; Sun, 8 Sep 2024 14:06:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6C4B6B00A5; Sun, 8 Sep 2024 10:06:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1CA76B00CD; Sun, 8 Sep 2024 10:06:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE5076B00CE; Sun, 8 Sep 2024 10:06:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id ADC3C6B00A5 for ; Sun, 8 Sep 2024 10:06:15 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6CB76A1AE0 for ; Sun, 8 Sep 2024 14:06:15 +0000 (UTC) X-FDA: 82541745510.30.458EEB5 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf05.hostedemail.com (Postfix) with ESMTP id 8D7B3100018 for ; Sun, 8 Sep 2024 14:06:13 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZrALq5km; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 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=1725804261; 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=urKSu062/ZI3Gei+tWS0YZoIydBePxyB6FQbwXL3y3c=; b=B3xH0wO6tOHXIvALpZLsvEk7bkUTMspZQsPUNqhdk0O8YGbIm8AV16qtIqdme1vQhIu9QH /TgXWOyY022YiLbzep45pgcqLKtGuSDQX6bN5DDT4fAYT5nzwPZljgFfn8e5c4RTETaMlm sMjGTK/MwVhyhHxmZU6JkHs2JwcoqlA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725804261; a=rsa-sha256; cv=none; b=Hfn5e1MxrwmUtOmjgEhSf4uDqatnCVH/BBDMEu6VYQhdv508gB+EdBKksb/rOlofxlHWhb g787pcfhQGDauiTruFR8OHmSJ8IdVxqar7uvutRMtwsD7P6dKHlVyqC/aVGBAtxF77lSh2 bnLbzm/udSTKu7/VrG8P5H3UApreqZQ= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZrALq5km; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf05.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a8d4093722bso119590866b.0 for ; Sun, 08 Sep 2024 07:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725804372; x=1726409172; 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=urKSu062/ZI3Gei+tWS0YZoIydBePxyB6FQbwXL3y3c=; b=ZrALq5kmSII5cjVANwgZHKCAEIs/9+MJDExQyOHdIjRlAa84kONRfBdhXW+m3a7cNC VAzRsCqbx9f6LVyG6f0NCMpHj/o32hoDyywAURuFcl2NQf94JUU+obn1PnAJL3dDbGLf e5BHIYt665ffKIzLESSREAHCMX8Z1QRCDvsJ9gZxuuEiyL+VrlcOR32XVLz8EOhfxpjU OByGPR78nmK6XTClRxANjoCHZmeRxBeQkbpiuE3GkUcEhEbp2mKuT2VNWnJH02oJdW8x pRlGUAbUHR6KBaKROJd7I16RJICJXvklqEGz+drYwVAeAa9TQ8eq2YJfOjTEQT4FQmK1 cKmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725804372; x=1726409172; 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=urKSu062/ZI3Gei+tWS0YZoIydBePxyB6FQbwXL3y3c=; b=efnUFdGPzYb485q5LXj2gcuuaS81VtrkdylqcAL9Kerjw5L+WdpXoWKSbKz14EQrwW oONr6FF//b0QTyvSjwIZryWkueKkJ/Ijgi9EgqlKJ6U6zY0j+8O7A5yOhl+TFAmpbuS2 8V0phud4gMaqxq0x/7Q2JY2vZsvb4l0MfXuyQEPgHjQKSbKjCa5sx3mH71vMb4DB78LX JmbA+gmOsMiEG4lwv0UKm6Do2rcDV5/3ee2Y1Baiu2BILTBw08dkkoNwTcWA/xL++HW7 2BtFQ90Um9vpczTI3VRHai0mYqcR4a2yjazsp0AIqmtDrnTKFK6Qw8uoHEfq8VSutyLn FbFg== X-Forwarded-Encrypted: i=1; AJvYcCWYSvYkFfcZN9tjXt98Bm48dhmRJ5J/hSyTwP+j+c1GcJXpaTbfYZYom70zDRKoRH2mjmDmTw1WZA==@kvack.org X-Gm-Message-State: AOJu0YwLbc/csYoIjUwh6Aqg4NKPXeJsOf6n6P4TCt5o7vqKacByBajv 3yJcJ+MIT0DJ1n1GJjTKjwVQG2LrkIgGGdtUV7gC+C/lMMV9z0E/ X-Google-Smtp-Source: AGHT+IHJIyN7ZjYqcRFzW57OQaEQsdBWl25WOWmwnRwLSqRy+NHyv+bgFmOMpXJZSCCgUERcY/bfGQ== X-Received: by 2002:a17:907:72c7:b0:a7a:a0c2:8be9 with SMTP id a640c23a62f3a-a8d1bfcb437mr679413166b.18.1725804371825; Sun, 08 Sep 2024 07:06:11 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25d65cf6sm206137466b.222.2024.09.08.07.06.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Sep 2024 07:06:11 -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" Subject: [PATCH v2 1/2] maple_tree: remove maple_big_node.parent Date: Sun, 8 Sep 2024 14:05:53 +0000 Message-Id: <20240908140554.20378-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240908140554.20378-1-richard.weiyang@gmail.com> References: <20240908140554.20378-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8D7B3100018 X-Stat-Signature: jksr4tj5m4bffprjmfq65pkrs55eojxj X-Rspam-User: X-HE-Tag: 1725804373-152882 X-HE-Meta: U2FsdGVkX1/2fTxfPTX/nU42CgnQ71363iyVAcYJVzJM6klRjtP8ZAqot4i0N8doJpSXeDsEV7ofufYrZ9Ivnm3b1+ThUmNh1JLaMYHrA8q6DA5khUrpTZ+v8rdA8nzFG8XWgk+68m4627aY1a9p11Gz51NLWsRP9YZjee2+YFrKaszpvn3dsEtr3lDPiM8Tz2Ohepe2dJnRzVop9n1RhrLMfmvkDHU9lkXuvOxLo31FK3YWSt5aARGiLqzAtX06J4p4FtwOkO3uOozLHUWMzomCcrXhb4XSd/SSC6khq4DVrVU5BNZRBa0ImEcwAupFSR34ddGKIhgM4smpFBSSwjj9j1t4EZ3cg2EERWlg6Uf5kSyqNENz6V/awUHsOk7+n4OrePCFGhPcXmk/ZLu+aFdblWEt2Fd4/8YaAtSBvGip2nCrRWno1PrZ3i9g9lnatd5tnT7xvy0nKTClc/LjU5iAWoWnj5dQKeJb+TlrlcouXEl9HkkoyxeLrMm7d0kJnp6+6oDR9+ItSLC3COKaGkmUo/x5XRE8UfqzmKEjvYKGrzO6S6ZQl9LxIvZHMI4TQp3TxJlvtlmEOD+d9Az0cYB3WBX/oPmPKacRwcScPcR9RZPk6TaftQbq9ft5IBiTF8N2oDXiWh+8MYes0eDGPcR+GcLGnrPyuUJms5S0y2T8H+aU3Y/tu485msNfuren2Eb7bMcQTG/eNjgYmV1w+3bPc3w+XVxqytqAenW3+1/YfSw9WC3uzUyjoluQtNwGOblLcy3ZQngSRNk6JNxdkphdVRwnCAGj+IPDcaQvoNIk4pzuJSLXb7GGmHFdpAswTRdkIJJwZ9ifqwvHKa3jHB2zAvSIHc8mk+1T3ohfG2zu0aouB4AaK9/iOewGUs9CXte05l6pXV+8EVkfjfL/QZIJ5bHZWq20EdMTAZznDEB94x8dVLJZnXhHwsFRhrEYlz2BdqdV4/9Hf2c2bFc URWY/gPi qVdm84O++mfKzgHZHEl9qQ5vmBw8hbNXKdAXHsgfz3mcO3/oqkA8EDEk7FR6IO028kr7mWGzSLBTQQnpWMHXF8DticXR8ZDsEPHdE50iegOeBAbDP7rzv21JnSnXWrHG/XMiQvLu6Hqwm5IVTfH0WZnzNk4lXpb0FKK0MEQe2SdN1ot53MPDo+qYFOyQ3mQmy91k9UDWU9Vxk2Lceq4cDs2bUqeAOYfWqUuVKGnHkySycaW6DtB8Uak5B7NSiFYk4jsftTWMIPvEqQ/k+w6/HdN/0Bly/FnRVt1e8Y2lii4WE4G9JWViHYHw65mOXSXcHG51FRjT/YCCiL0va/uFQUmyg2SyBCi1rYwxpcWC3hi3XtEazWpX7A4q4xXtvKbpmMftn2xNidU5gPYActk/Bgo4qvhU12Z7khUSO/SOWJZQ8Er3nkXXlWOf0EhyE8e1HBXiQVgh5wbAre9I0wUFiV4kBANLuJaONpilLoP0U4DH74McEtyG/dKZbm3seiSkPeiyW 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: The member parent of maple_big_node is never used. Let's remove it which could reduce the number of space to be cleared on memset. Signed-off-by: Wei Yang CC: Liam R. Howlett Reviewed-by: Liam R. Howlett --- lib/maple_tree.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 4e08dd5e391b..c3370c7449c2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -120,7 +120,6 @@ static const unsigned char mt_min_slots[] = { #define MAPLE_BIG_NODE_GAPS (MAPLE_ARANGE64_SLOTS * 2 + 1) struct maple_big_node { - struct maple_pnode *parent; unsigned long pivot[MAPLE_BIG_NODE_SLOTS - 1]; union { struct maple_enode *slot[MAPLE_BIG_NODE_SLOTS]; From patchwork Sun Sep 8 14:05:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13795494 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 DDC48E6FE49 for ; Sun, 8 Sep 2024 14:06:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2377A6B00CE; Sun, 8 Sep 2024 10:06:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C2586B00CF; Sun, 8 Sep 2024 10:06:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 015186B00D0; Sun, 8 Sep 2024 10:06:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CEF1B6B00CE for ; Sun, 8 Sep 2024 10:06:17 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 81E5C41C47 for ; Sun, 8 Sep 2024 14:06:17 +0000 (UTC) X-FDA: 82541745594.10.327B382 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf25.hostedemail.com (Postfix) with ESMTP id B6767A001D for ; Sun, 8 Sep 2024 14:06:15 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GFJ3zaq6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725804294; a=rsa-sha256; cv=none; b=2trzT0CTdv2ofwr828tP6SR4X23AtJp3ionVzFfAWMqjgsr3RpaQD8KVKXkh+smaeT6Nl5 hK4dUJOoAlZGdo9pHcAhichF4oeDfHS+yeDHCfhY7uXNgumNTpR0n2MDFJ5WOt60fSUjGa MMg7+DrUy0F8oKc39B81dKvMoZSh0lA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GFJ3zaq6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.167.52 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=1725804294; 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=DtE8y+JoGkMU0EtGjA8BDr7YhcjruLSNcD2Q4LOUFNQ=; b=vhRwvuexI/zEu1hXI+NlRDhbRCdqgAC+crZA32DbWd+etmNyltKEFXHfWMVJ/d4OkXLszx zHnOWjnEzLulf2iSOFT8Ijay3vMFoVXfeviI0ZwN7ygdCwWYBTCIZpnjcTCizSTEJ7g25p 8AJocw8+mGNkpIIsxMC+/LfTak5K7Bw= Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-53661ac5ba1so970468e87.2 for ; Sun, 08 Sep 2024 07:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725804374; x=1726409174; 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=DtE8y+JoGkMU0EtGjA8BDr7YhcjruLSNcD2Q4LOUFNQ=; b=GFJ3zaq6426wRUMLawD1s3CFo0R8QedNgcPHJOSlH5KGRvC2cdOSjpmD1jhF3ic41d o0LQVc23pK2zz/Bj0aWCVdl5ZLSm6JSNNA/3YEEk9jgl/0hl/ESIugbJ2p6hEFCw40XJ iyJt6HYJG/FmQndBTaBZNKwPbUXl4DP2t2ta7qJsobCqQqUwyUkXO0erTnGhIwpzJxta GTWnyWlPR2O77Wfk8wIzBDf/vWP/cAT3fNoYLJfCJtpoFaBC/L0uuCR+t8X86WzgQcBy iQqKF5qGpAFCnpBF4pnKWmInVlMMtPXjKFdcx90zoUbI4M3crpwpL/RKX3SKGX9LnP0r Dijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725804374; x=1726409174; 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=DtE8y+JoGkMU0EtGjA8BDr7YhcjruLSNcD2Q4LOUFNQ=; b=XGJz4OqKXdPuQjn6vErwQfLHmafwWTTbaMrLR+8S4CWecQtb7gdaBpvsCeymyO6GVi QRms9wIneT6GIWwsMusmrQ7Y1eV2jPXAwm3pIGTJ3ZGB2bZUTKrIG3fd3gflANj0C5HZ RrNOo3nQo/FEPAWprAoCSVBE+jUmdRyAcNaNk3TsnOnDPkhwkKfwZ46FYv6iD6oGBMX/ M6roputraNuvGKmLqxI06UcXqBTwijNvWePjCx0QYvSZJkvzUu8MHolV5AgESlhTWHx9 BmHRc3YUGRdhQSh6T3KcxDhg75G6mEspQcPR9fVdXZ+y34sN/MeRXKGd6qplGd2A8TeW xTmg== X-Forwarded-Encrypted: i=1; AJvYcCVejB2qHK3SSwMaw2USrhJ1h74QEkTQ6yNIEuAPqUQ5qqLt/E/SsukxiazV3cf2KioNMRelhGffmQ==@kvack.org X-Gm-Message-State: AOJu0YwDwLF/gz6PZrmwNS8M82HNlepgI3MYqehmf0cBVeWucU4qHOrb WFazzLMl5tP/jTEi6bIZEIwLETpOPVVJqFti8fFwWkzdrUdkQ+cn X-Google-Smtp-Source: AGHT+IE5RwOMG+w4AYwQwqH5newKa0DDKgBPIskfrRQfnaLQOK5GMCB/fZcudQwWb+ZRuV9wn8qLFA== X-Received: by 2002:a05:6512:3b8b:b0:530:ea2b:1a92 with SMTP id 2adb3069b0e04-536587fce7dmr5726629e87.43.1725804373394; Sun, 08 Sep 2024 07:06:13 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25a25897sm207852466b.87.2024.09.08.07.06.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Sep 2024 07:06:12 -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" Subject: [PATCH v2 2/2] maple_tree: memset maple_big_node as a whole Date: Sun, 8 Sep 2024 14:05:54 +0000 Message-Id: <20240908140554.20378-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240908140554.20378-1-richard.weiyang@gmail.com> References: <20240908140554.20378-1-richard.weiyang@gmail.com> X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B6767A001D X-Stat-Signature: yjk8ga588j3eseyxkt1efdzubq7r5yao X-Rspam-User: X-HE-Tag: 1725804375-496756 X-HE-Meta: U2FsdGVkX1+P43WZPhrnNNsOfsx+1b0KRzG4VwvaX9m6NBK+O98+21x6q1MrUAhQ/rDd24fdalwuxDm2goidoIOqG1LUTRnaH3de1riu3uXtTiqvCVVdahAAwFpG1GilDKqjLSPAY/cgqVed8a1YvmxiHVjyxruqe80S+0AcUjUHmUNULGHu8YuDdcyk4xEECGAihGOQgjY8Ghv0QeYNK9Sgz6SN1NBEQZbxCQIawvQCmlLlre+e74ehyB1ntRmrStOyk7iBN1KIn5hJGWD98AEnIbzRKhuXMkr6BNTCQP1mIfh8sikj7IpgAXfIso9kYL1jgE7cXPiBy2lkFTaWuoaXepQ6HRp/s/qTn4Ld12DsY7d5VaUZjpPOa6BbAFqje2RaAehvTyf8cIikNNokTE/to1WXv11vtZMtEvn8jE6AmbDdKvVvSIk0RtlDYzT23BhpGYGapLwpigPbue32t9suqybZi3ihnMTZVOVSohD5J0Y6B5mIvNerNRKWDXPYrIERWBa5zeMc5qpmVc6yhAAaY7emWG5XqOewwTVsYL+I4U0gj321fxEZG/awKyAGCX/kG0Uq+Gd9Fc5mbd17hhOGWFpgsNqm1EMoTqWetn3L2MTA0Rhmw1+TatvCs67g85pgcDd9m4F1WQBlmFlxn1m/64euAqqVffpdwieG7azlTXk5Nc4W8DXfD88gyCd7GdQAl4WIlYZxYLMVNSFrE3zz29QWqb9M0eFn8C0eei+CkgHly5GHu1EhApwda3oi5SgfBfVFmNRrpqifu+CUgNQ/Wp5By+kGDbslq4yN0OKBrgi+jtzz9XGiNw1cVklEEuwniqmlMz8dFBj2e8TccIIGPgV0kgcA1PMusLmWyemnPJKBX7YSeVueIc4JkJ4Qe4DMXZI6rdNL8h60K+1/FhqsoyfrlmzKV8bR9mAWfj4OWLCk2vrPUQZg+rB6WFcNOIaahOUEJfv2m0VMFGg 1dzXf6OP Fez5A0O+zCM3v21iwuCeFT/A7r2ddkvdUzqr0LSICrElwTw7dd00yWo8xH1DXYe4WWzieLM/JdxUC/gXGth28OcItR15TJs2qibgsWxu1B1Jd6/23psNEuORpPtt5TzDBEfTCuVm3TZlH2xa3ivUhIKlYOJXnkYk01sKDhv77DMLcggcaUlK0eXuxTORzPp4CDdzGfhS5536PKTDnNG0qTlc7ADWz/V/l40FKtaOZ3TkvIgX0/lERl7Pnfr+5TKfOQX8JoeWqZNpA9diZJvOfMrNsj0xFjQu1Zm4NVv9gxOS598UyLdUqFoGaTvvi/LyQ0YH4cMhbzOHSNNymTWeqVY5uYlKF4+zc7sIlCuQzh0XDxbrC/rG0kmdVR4/lrRTl49oQc6Fe39owfj2CJtWQ/oNQ3NVviG5aHWp5k9Im4hxwhPssYFNB17A5Tr172t93V9p37ISgQLqVjoWjhCCdwVae/Lwuw3qGQ0eR/Pq0CYDKULOYBA4dhtzewUWmP45emdYt X-Bogosity: Ham, tests=bogofilter, spamicity=0.020151, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In function mast_fill_bnode(), we first clear some fields of maple_big_node and set the 'type' unconditionally before return. This means we won't leverage any information in maple_big_node and it is safe to clear the whole structure. In maple_big_node, we define slot and padding/gap in a union. And based on current definition of MAPLE_BIG_NODE_SLOTS/GAPS, padding is always less than slot and part of the gap is overlapped by slot. For example on 64bit system: MAPLE_BIG_NODE_SLOT is 34 MAPLE_BIG_NODE_GAP is 21 With this knowledge, current code may clear some space by twice. And this could be avoid by clearing the structure as a whole. Signed-off-by: Wei Yang CC: Liam R. Howlett Reviewed-by: Liam R. Howlett --- v2: correct the change log on clearing all maple_big_node currently --- lib/maple_tree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c3370c7449c2..b459fe1a3ebe 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3134,10 +3134,7 @@ static inline void mast_fill_bnode(struct maple_subtree_state *mast, bool cp = true; unsigned char split; - memset(mast->bn->gap, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->gap)); - memset(mast->bn->slot, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->slot)); - memset(mast->bn->pivot, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->pivot)); - mast->bn->b_end = 0; + memset(mast->bn, 0, sizeof(struct maple_big_node)); if (mte_is_root(mas->node)) { cp = false;