From mboxrd@z Thu Jan 1 00:00:00 1970 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 663FBD20688 for ; Wed, 16 Oct 2024 02:18:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8CCBC6B007B; Tue, 15 Oct 2024 22:18:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 87D216B0082; Tue, 15 Oct 2024 22:18:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71DB76B0083; Tue, 15 Oct 2024 22:18:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5468A6B007B for ; Tue, 15 Oct 2024 22:18:36 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A4E29A0A04 for ; Wed, 16 Oct 2024 02:18:18 +0000 (UTC) X-FDA: 82677856548.14.64411BB Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf17.hostedemail.com (Postfix) with ESMTP id A354C40013 for ; Wed, 16 Oct 2024 02:18:27 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZoKGnKSy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 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=1729044956; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MpbXgoDwyXLRhaPFZGByqm03g1KeiBe12/cNZR+wvg4=; b=0dphOQSUeRJ/WOi1sVQWa1VznEFu3IfHKd9sa/e3kMO8sNfBnKcAbXTDBlbsd430i3mbu4 YKu8STvCyxdG7+orG5LU5oWDH/E5cp6OSzv+CtFizl0GCRHvRB7iuIMf60nUv54VFoAyDQ V9eiJCXYNd4kVEZ1OK+L7oyUX05F51Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729044956; a=rsa-sha256; cv=none; b=0gojQy+ky/upC+5+pw/V1uN/7+ESBrZ83Ur/GxZViSEjZWl0cE3bxVD5kBZR6ESxHatYhs FF9u5qobPGKM4hTuGe5fj9s6zsKIf74x1uQe3A99o7YY46GUN401sArntxFQ78YJM1md4c mt4F4NWKg6lhOcYQ3FqZiLmUBYxDAP0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZoKGnKSy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5c9850ae22eso3062282a12.3 for ; Tue, 15 Oct 2024 19:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729045112; x=1729649912; darn=kvack.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=MpbXgoDwyXLRhaPFZGByqm03g1KeiBe12/cNZR+wvg4=; b=ZoKGnKSyHkt29bRX8K3Dnu8q3txtBFPskFiyKH61j26v65PfLvuRoXMWfzt1ALAfaM 0tHeyl4P4y0eECDUnSLpzY3N+VWvNp6eZg5obWQ4KVlQgq8L0Xhfg1GJiEP79fq+sa6H saJWIGd1w+ko26UotJoNLjQXQSwvYmrECmaWv5/foKH4NdwZUwSxALtGOTM6j1d+C+31 7hWp6QCzpZE78URzN55ow77GUxaGqZMtJhriAhRzPyW9AXAbczBGZ3bS8nRcmGyrphPb nuvNqDdrztPcVvADrUmfi1aWd0OLENkKwDosedEmEMEAgnt8nXlWzMl+/ucOb0PeV7QH sQ0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729045112; x=1729649912; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=MpbXgoDwyXLRhaPFZGByqm03g1KeiBe12/cNZR+wvg4=; b=j47LjYjjirRUJlUB5FZgUQjB+isTV/6Ec1w3kuLzIFDLPL6ewIWFautAWtps7QzzJ0 3ARHYERaozn89HbT2584W/cVAp8cCa8x42h9coOFA5w1cImTP6khJrtISo1YnAm21ZsH cWtDeOI39q4kEC641qm9gAk6Co5mQtmsglI/Lg1Pu+wVX0NO1e9yXwKozv4pYGBZUhbl AGxzO1vhfuqPJVEvWOLvNvoAPz+ZHci6pqbiZTQ08CCx/AfkqOjevwMnUjrVlV3F//ij 8vGq5LevLUL/NYStO5StW+ixEYxl229Mi6RxXz8fUh38TxRDtyRW0GAVRmpzZ40nLWHm L/Pw== X-Forwarded-Encrypted: i=1; AJvYcCW2JULci/hX7SjUFEnY+c7C19MqemKIlfZWCYvddtN+wVRC+0+uILfPJcgXpVVaSO3C+kgv0+TXmA==@kvack.org X-Gm-Message-State: AOJu0YwiIaEmjCQ7TDlMa8uLiPVvZA3HCo49/nq+RPWn8vXP29Vy3AKE dhb2bo2RSUD5yJv0mDQSbL1AXPZju+7Po0U6filFiTY6my7lgCDx X-Google-Smtp-Source: AGHT+IHKYMWJcNyJ0ymQugfQ692nZBCQ8jCnImqsDHPGblUqxuuwdNL2rkbo8cpfBzGUwX1QYAZWdQ== X-Received: by 2002:a17:907:efc6:b0:a99:f0cf:f571 with SMTP id a640c23a62f3a-a9a34d41ca2mr164798466b.33.1729045112301; Tue, 15 Oct 2024 19:18:32 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29822de7sm127595166b.131.2024.10.15.19.18.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2024 19:18:30 -0700 (PDT) Date: Wed, 16 Oct 2024 02:18:30 +0000 From: Wei Yang To: "Liam R. Howlett" , Wei Yang , akpm@linux-foundation.org, maple-tree@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH 0/2] fix mas_new_root() Message-ID: <20241016021830.6pfc2z3f62qh4xuf@master> Reply-To: Wei Yang References: <20241015233909.23592-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A354C40013 X-Stat-Signature: chtghxx3h6baxfcnsebcuagn9zbpiy61 X-Rspam-User: X-HE-Tag: 1729045107-365619 X-HE-Meta: U2FsdGVkX1+SaxiWn5hD2cWcLVPer+nZ9I5bQN67Os3moq5bwFLIaE45rUuBv91ZOxwZ6ktyVrGmLH5NMCUh6r1cDIeHUmG6vluiLDO+uG954jg9uNm6oaNHk9PgAlHB1kUhspJ1Hrmx6zc3Xi8Kp7T2VgpYAB555CXqvuL60KVnehsxUnf0GuBjUDHfzE1fWv966KzJo1Xgypt4i4EUMeMJ3Zarvtqg6o6530u9V5pGkD8VyGcsEVJK5pGto+VY/ANKfc2m2v8ovRFzY/9b4OJhXeuvh8Y/H5w4/zVgA2PdSp7Z+8Y9UozNE2q4sWqkwdGlKaTByBC3FnJYOq3X33i1jrnmMKdllWlo0vMvaBas+zLhVublP5dY5aE5EOuJ/xYSCY5mu9oh23h8COpnmAJ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kJS9fC7cYnE/U38aF31Y+jBkQGWbkh7YHZQvlFsfwa8NNSgP3NX1WXG89VadnEGA2TUYombK+f8bZzGR/sR7K0rFHpNF8a6TD1zYxox2MVRtUal2BRMaFoNtOtttP/S/ZDoM/0SXQISfsJT1KtbfQ6IJPIvT7DxIBLGh9KkgJ+vbnMrkvyu0BWnc+AvZ/w8cCrzsKiyaI2KVxrMkPEEfS9TLfVfXPed5Fsu9hv7BTQV90ChQ== 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: On Tue, Oct 15, 2024 at 09:25:19PM -0400, Liam R. Howlett wrote: >* Liam R. Howlett [241015 20:42]: >> * Wei Yang [241015 19:39]: >> > When overwriting the whole range with NULL, current behavior is not correct. >> > >> >> This is really strange. You have changed the code to be wrong then >> removed it.. The second patch removes what you changed in the first. >> >> It doesn't look right today but what you have done is also not right. > >Looking at this again, the code that you have changed is correct. > >I actually think the bug is the other way around. If we are >represnenting 0 - ULONG_MAX => NULL, then it's an empty tree and we >don't need a node to store that, and shouldn't. > >It's also not really a bug, but a missed optimisation. The ranges are >stored correctly, we just use too much memory in one case. > >The dump isn't clear, but since we merge NULL entries, if there is a 0-0 >-> NULL and 1-ULONG_MAX => NULL, then they will be one and the same. >You could change the dump code as part of your fix. > >It's like the init of a tree (tree->ma_root = NULL). Agree with your above statement, this depends how we want to handle this. The change here is to make the behavior consistent. Want to confirm with you: the fix in this patch is fine with your, right? > >Please don't submit multiple patches to fix the same thing like this, it >makes it look like you are trying to pad your patch count. I'm guessing >you did this to keep them logically separate, but when you completely >drop the entire block of code that was changed in the second patch it >becomes a bit much (and hard to follow, I was trying to figure out what >branch you were working off because it didn't look like the patch would >apply to my branch). Sure, will merge it. > >Please submit a testcase with any suspected bugs. If it is not possible >to do the fix first, then do them at the same time. I often write the >fix for a bug, then recreate the bug in a testcase and ensure that it >fails without my fix. > Since user won't detect the difference, so a case to see whether the root is a node looks good to you? >I am not sure the fixes tag is correct in the patch either, since so >much has changed around this. You could test the older code to see once >you write a testcase. But the bug is using a node to store 0-ULONG_MAX >=> NULL. > So I should drop the fix tag? >> >> >> > Wei Yang (2): >> > maple_tree: not necessary to check index/last again >> > maple_tree: one single entry couldn't represent the whole range >> > >> > lib/maple_tree.c | 9 --------- >> > 1 file changed, 9 deletions(-) >> > >> > -- >> > 2.34.1 >> > >> > -- Wei Yang Help you, Help me