From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 300EB48033E for ; Wed, 21 Jan 2026 09:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768989379; cv=none; b=qFUaTtAVbWb3iLJ/5bVBj/ODLBuIefA3k6l8XNy5DZAP2zrtCN2gLCPeANUW5WXd6hkVkqBVct7dfucMexbH3yW0wibXqNzaOWCY+g7QZ3LnUl5ndELTBYHOatKVCUFC/DxH0jEaRz0gq03NOgaBdVX1WBIMsRoR1Ff3fpY8XY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768989379; c=relaxed/simple; bh=D/1nFj1TUgCklyJBJXwrUTXWFx+1ow0AvWjCsbLz8oo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=rxL2yBxN2AF/Yc8upeRlg9kr86atWUyKCOKj/oimZemvRLS6HbzcBX4qm6ek+mHsagSbXb851zvM2mcP0LUJnrAFt95qLWFmtxiQLB1plMjCJS0uGNMoCcHf9GmF5dbcOY01MLe+wQvssNo7ipUuTU49fLi5tRCMwijGSe5eqSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hbzzwsL3; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hbzzwsL3" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-432488a0ce8so5294969f8f.2 for ; Wed, 21 Jan 2026 01:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768989376; x=1769594176; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=r4Vdmpp6SDCxVlxf20l2O/7vEQ7zWkGtSlAUCfaFALE=; b=hbzzwsL3Q8eNdukQqvgVfawWDUTRKnAsOZixxCxK5e5UQR5EKIBAGbZ1eduGZoTJLp CA/lgljDKjqxzLUcr4KqbM3E1185FDFpRFuRZ7RA6A0q1I0J/mLvpFCWpb4A99Sq19jQ gcMoV2BRoWCJ91CcQda3ObCOmnm6YEmbNYNQd6KCKekQJTfTHh/HZBaeOCAc5P+Xv8tW Si56Cuo7PMZzqOo9AzeUFxtE6oLDcHaJ+MI9UqoAsdxj3hsliMWnqeCezqQjLKoDZzJE X92J1PoQap8eQb/0vyEbTFy7KZu00Tc2VV+4r2JWITMcpgdNaZBhAJVIff+wnEIQqiLB lMEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768989376; x=1769594176; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r4Vdmpp6SDCxVlxf20l2O/7vEQ7zWkGtSlAUCfaFALE=; b=ed3s2IupT13lDRPg2gJzNSHOCcERAqk82DspAFfh7Nt6tjL2CJGdgZeGTik9Sscu20 qr3J1BcZmImn8QFQMTDjsPXhz7JGSNLRtb9O0E+Km1Ql8zHbhEx1lof5TDac2K6XaPjo IyEmUJciKJTYd84L1aa8i1h1sW8wcZvRGjZLw6bsLQ0SUrTd96xoXpx9/0hSF4fE4oHv HqzDg4KDtddTIVyB6tFm58ulo5O2Y5HGNDOcMv4j6g0N3+ujre9Tj6GqZvGYLHkHYAiL jPnEMGUDwBeO1P7xlflFU+Uknlecy+YDIh8vVEhaZuas4hXU2VqVMKNQkfbEL6dMlO93 mOnw== X-Forwarded-Encrypted: i=1; AJvYcCVJWEqd1BNCAwCpiQRpDZYVUJPel+n3WqtuqVl9kasDIWYso/gXfYcWp88aDLESUehrI+iICMxN5eK5sBc=@vger.kernel.org X-Gm-Message-State: AOJu0YyxKgllzQdl5rAGIRJIuptxznkJlMZuSG5oOjc52RQTus9o7xO/ ZIznB2OOev+ILoeYZEkBhRzH4p+aQl90d6EiR+Bz353jNzcEOJXhfJpC92s1hKHcup/JpKsDwjN P43U7k5lzYzW55iNMxQ== X-Received: from wrbfu17.prod.google.com ([2002:a05:6000:25f1:b0:432:84f6:8d9a]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:186f:b0:432:7d2a:2be4 with SMTP id ffacd0b85a97d-4358ff6fb27mr7340210f8f.60.1768989376449; Wed, 21 Jan 2026 01:56:16 -0800 (PST) Date: Wed, 21 Jan 2026 09:56:15 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260118-mas-next-doc-v1-1-827d9f4924ce@google.com> Message-ID: Subject: Re: [PATCH] maple_tree: update mas_next[_range] docs From: Alice Ryhl To: "Liam R. Howlett" , Andrew Morton , Andrew Ballance , maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Tue, Jan 20, 2026 at 12:54:47PM -0500, Liam R. Howlett wrote: > * Alice Ryhl [260118 06:00]: > > If you read the docs, it sounds like the difference between these > > functions is whether mas->index and mas->last are updated. However, if > > you read the implementation, you will instead find that the difference > > is whether NULL entries are skipped. > > This is not the intent. > > mas_ should return special values including the XA_ZERO_ENTRY. > > mas_next() should get the next non-NULL value. > > mas_next_range() should advance the maple state to the next range, > regardless of what is in the range (NULL, special, or a regular entry). > > Both should update the mas->index and mas->last values, if it moves > (ie, no error state is encountered). I guess I'm a bit confused about the difference between XA_ZERO_ENTRY and returning NULL. Isn't the case where we return NULL when a slot has been reserved but not inserted yet? Like the docs, you use "get" vs "advance" wording here, but I don't think there's any difference behavior-wise? Is one intended? Alice