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 2CF07D11194 for ; Sun, 3 Nov 2024 23:09:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4CAB46B0083; Sun, 3 Nov 2024 18:09:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 47ABB6B0088; Sun, 3 Nov 2024 18:09:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3420D6B0089; Sun, 3 Nov 2024 18:09:46 -0500 (EST) 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 187DA6B0083 for ; Sun, 3 Nov 2024 18:09:46 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BD58C140664 for ; Sun, 3 Nov 2024 23:09:45 +0000 (UTC) X-FDA: 82746326964.10.80677A9 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf04.hostedemail.com (Postfix) with ESMTP id 3DAB740007 for ; Sun, 3 Nov 2024 23:09:04 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=daOHqO8Z; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.53 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=1730675249; 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=api6lG8dXQKrBxdGlpmBbVhFKJxwmtEql4gsRFxbE9w=; b=behN1zuYieH5MJhZushrMJRqBaEkhrpMsU2tGRlK7fcaw2nyOyHplRsf8+2/rbpOeleAWR YRjnZOIJa1fZpiwYCWBj9Ci9akTS7iTKeuLjOIkvD0JLPF0WoNSbBiaeEdXvupwFhe/tn6 VOAxuHWI91VxIhCBA20wSjMHlYxjppI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730675249; a=rsa-sha256; cv=none; b=SI1d09her4sC1gjL5xEemHeiMk2cTpp5kJAM7nVWM866fjEMz5DSQmZrhrYImnhla5RDG7 ALKeS+Nh19uuATj6vE+QQjaw8gcct3W7L8GguqZtw5DGdb2b98um2L4sHo+NI9e3hHe2mn wHsIp5HnHFR7VaERScG56k/CMdTl6J0= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=daOHqO8Z; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5c903f5bd0eso6487364a12.3 for ; Sun, 03 Nov 2024 15:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730675382; x=1731280182; 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=api6lG8dXQKrBxdGlpmBbVhFKJxwmtEql4gsRFxbE9w=; b=daOHqO8Z7wgMizZioBu1xk90MKoJZC+88tEViL4jEJebpVRidSms0EbJ8v1ZkvugiQ QdqGyzStW2IG4g7VrPpgxofgtEx67/WojkeXPkNXUOxoTtJEQh/zX4xJZSkjBqDIUTSd wY5lHRxKKtN2nd5IMno36tPkM+BNP8tsCb/GA1UF4I70nJtezKgLYSL67c1uJwj7aaDI d2YvYJp1gIqQKNhLeGKb355uxI9fyc6xrCgXeSjEoGduBm/n/sBxTINDKnd4xp6o0WZP UNQ53wx/X9gIARPfdq0sGdwRHqnPZolzqOOx/H2Ju0TUjPEj27GnnWi8M3P+M5POCbu4 qNTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730675382; x=1731280182; 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=api6lG8dXQKrBxdGlpmBbVhFKJxwmtEql4gsRFxbE9w=; b=jUbV8hFyVWps6qW4ZCDtawubCQVBPGj26nTKmaaWBm6JvtNQZiyDYTJIFNxfL1wU+Z yL1t+9xtg7Z50u4byI1UbEke7t5hTbtkNGYTb8SGeD6uDcBAiyA4fc+lw33CPtN6IzAl Xi8aOPjZHEGeghJmZKDlhH5WeGY2n1l0Wb5yykdsFDB+tZe5+rPpKhy/YQOLKpVzv87y GaaN7+JlOkMB9N/k1Pk3ktwh/0mMmdQnp0/AdrxEDQPi59ryqqbdSyUCRqocKbc7aH47 mtNDVBmJWTRjwEmZTFickGMy8t+UEV2TBarNHHXPoEkLnQ1E2f2pBWZvDRSYtZmVW17C 3imQ== X-Forwarded-Encrypted: i=1; AJvYcCVZ6H6vd0OErAurAViChUTiurVWcIVIEu+nBaTsp3iYAFpjlgb0gGsF95YM3D66XLBm/b4BIt/x2g==@kvack.org X-Gm-Message-State: AOJu0YzENm5hSdcieAkQBVMDtLIAxrR+NK0SA0qSAdtRxLcuErj6kaNA be4c4etr2nPUdCMY9FUfJx0M4x5ZtFTgDG159KDHTYI/7HvvWTA94gajhg== X-Google-Smtp-Source: AGHT+IF5HbZPEnp4sRwcmzuFoxxfGpQXUbmetmEIty7EMyN/ypw2285H8AiXkITm8Z+9+VpL32q2Eg== X-Received: by 2002:a17:907:97c8:b0:a9a:3d5b:dc1a with SMTP id a640c23a62f3a-a9e508d5ba5mr1381091066b.15.1730675382012; Sun, 03 Nov 2024 15:09:42 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e564c56e2sm473030466b.64.2024.11.03.15.09.38 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Nov 2024 15:09:40 -0800 (PST) Date: Sun, 3 Nov 2024 23:09:38 +0000 From: Wei Yang To: "Liam R. Howlett" , Andrew Morton , Wei Yang , maple-tree@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v5 0/5] refine storing null Message-ID: <20241103230938.v4dxggnxubaqafij@master> Reply-To: Wei Yang References: <20241031231627.14316-1-richard.weiyang@gmail.com> <20241031172005.b129619e6832e23db8e9f21e@linux-foundation.org> <7rzjna52uetpxoywpu7fwd6vdc37joboagrk44idzvm6jyirw2@thgesimifxb7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7rzjna52uetpxoywpu7fwd6vdc37joboagrk44idzvm6jyirw2@thgesimifxb7> User-Agent: NeoMutt/20170113 (1.7.2) X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3DAB740007 X-Stat-Signature: rk4k1tdkpico9d99kqedrxtxbxjdgdan X-HE-Tag: 1730675344-37367 X-HE-Meta: U2FsdGVkX18AoVLwo3I65T3ic0You+8EHeh7kEF20pPSs0+QHTwNXs4EI7Vd6rbYlExWsRgOM1uoxxVbdz2CqQPUqFU6apclnHgy090bblRP2L8nWtU90c6v5ylf3LibqsN2WYXqrCsxTdmsxaPERqR1CpKE7cY3tHFGyporuLmHIDkCeHaf1kXQjWYIWmlzxDPdxrCs5W7wGG9Bk8zPD6/hMBsJ1IPmRALP9PIPwK2k6jywlA5+PIRt/MlfrBdqagpyQAIE5sx0jOM32opiBnMzpS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94mSBkinl6Vp5yE0nqbbzgyeGUxTalBBUFZPN6EJdZkg9MIBuk8G7bI5b2dKBpeEj6QOoAPsFU2aoRgTgCGI8ZBbn09L/TiK/Zzh60Cv6fy+9Exqr70QwxFHCYzs/RsT46knmwpGqhqAlJx6CsnLL0j8zYl7pKoaOaBnGYcMY5000TOt8jPyA12UysngCWGh5w/qOc9B4b5cbx6TUAFL7vPY9kiC6QI+0CioleIjaMGW6TZmsw1DWEG9rrM+xmTz2bCiPT8FiMncnazbIoN5zIUKRp5ExK+vQ4n0XhYcmOHmLoeYiGjwqQsn9K8fKlePJzWuT6sLbt9EplJxWG2hUFD3eV X-Bogosity: Ham, tests=bogofilter, spamicity=0.001152, 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 Fri, Nov 01, 2024 at 10:52:42AM -0400, Liam R. Howlett wrote: >* Andrew Morton [241101 09:54]: >> On Thu, 31 Oct 2024 23:16:22 +0000 Wei Yang wrote: >> >> > The original thread[1] thoughts it is a problem in mas_new_root(). But after >> > discussion, this should be an improvement on storing NULL. >> >> I hate to be a bureaucrat, but that isn't a very satisfying [0/N]. >> >> > >> > [1]: https://lkml.kernel.org/r/20241015233909.23592-1-richard.weiyang@gmail.com >> >> From here I extracted "When overwriting the whole range with NULL, >> current behavior is not correct", but that's still very thin. What is >> incorrect about it and what is the impact of all of this to Linux users? >> > >An empty tree is represented by having the tree point to NULL directly. >An empty tree indicates the entire range (0-ULONG_MAX) is NULL. > >A store operation into an existing node that causes 0 - ULONG_MAX to be >equal to NULL may not be restored to an empty state - a node is used to >store the single range instead. This is wasteful and different from the >initial setup of the tree. > >Once the tree is using a single node to store 0 - ULONG_MAX, problems >may arise when storing more values into a tree with the unexpected state >of 0 - ULONG being a single range in a node. > >User visible issues may mean a corrupt tree and incorrect storage of >information within the tree. This would be limited to users who create >and then empty a tree by overwriting all values, then try to store more >NULLs into the empty tree. Thanks for the detailed explanation. > >I cannot come up with an example of any user doing this (users usually >destroy the tree and generally don't keep trying to store NULLs over >NULLs), but patch 4/5 "maple_tree: refine mas_store_root() on storing >NULL" should be backported just in case. > >I said patch 4/5 needed to be backported in v3 [1], but stable didn't >get added to the Cc list and I missed it on review of v4. I added to >the confusion by stating in an earlier version that it did not need to >be backported [2]. At the time the issue of corrupting the node wasn't >in the description. It should go back to v6.1. > >I will be more clear in my communication on Cc'ing stable in the future. >The description of 4/5 is inadequate and I'll respond there as well. I will be more careful for this next time. > >[1] https://lore.kernel.org/all/jo4wjti235pqmzd6qaziexzjsavt53vmtyzyvw4htrcwpuxf4n@ctyucxk5avrc/ >[2] https://lore.kernel.org/all/ia7qdjv5c5hmg6yds3tz2x5to5u65k47ssgudiayxjqrowu4fm@i5la2j7kpe5k/ > >Thanks, >Liam -- Wei Yang Help you, Help me