Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1736587lqp; Mon, 15 Apr 2024 16:06:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUME0UavKTwXzBqwwyvFG9gtgqQAnCA5lhvvnMkol7Q674EToJdazMpB73D+b2dnEdjJGmkq+QDAeiuo/WXdRQTdx2YDmt7YTfcfuMU4w== X-Google-Smtp-Source: AGHT+IEH7+nx+KLjZvKFl5UGOFMzQqHJnV7XeXV+mFbQja041vEaI3gNmKW/UUSw5pgjaE4av9ZZ X-Received: by 2002:a17:906:234d:b0:a52:7474:48b9 with SMTP id m13-20020a170906234d00b00a52747448b9mr2151559eja.9.1713222383704; Mon, 15 Apr 2024 16:06:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713222383; cv=pass; d=google.com; s=arc-20160816; b=0GHWLEmJpupJCY/gUbX2565PyV6Wm3sSKd1iSMjDv4eVKNPI4CHJH8u4yb5mkDkAjM BZT/fbcLov0JSu/41kTzbcWCuP0bIwbtIQDZQXVwpN3+Z6ZHHdVqzLH9CCi+4p2gI9gH SwXR0SaSgdvmp6x6a2JC/z9O/Ge9vi6E2XyfzwwkRufzSnjuF7rnpk2HwfRHupjbjlvr kPADCatLlpsxw+u0z2/apwuxDpZF0TfYbbWSmb0Zg3Vxzrqr+jT8MaELcODM8hJw422W fnxdnwb0748JL+wsyfd0+m+dr5vBgMd6VzFaIBmhafe+uDExG7RnfF2L1NjxNVTitOdm p33Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MChLp9ws+slgrxOBUGCVsKZbu7NB1tpz2huFIgNyMUM=; fh=/CXW8othc9vUVuQUIDldUW1M5KhzEsnAKgjh+tGIJew=; b=NICYltShTgbTaHjAoHAMezWKahNfzurso6dtK9rVKysQGNh6KMntPJxE6r2BBPTn2t WfukrsVkJxj+2uvhd4YZf0ECWGhlrlmJkc9mCdnlQzzTOKnyQaPAl5r1aiRzoRiWYg02 M/plTUPH9sdCj8GYNvMVX2J1fBrCeJ1XFXpynHGn8SCxcr11OjeeVFcZdB68/yEZ0psu 7xkfH3StzNc0wumtMCUeRtQBYcfjJ9LpzBY/Dzg/agK38vzq+dGNtNdh9IA8qVMHoimV i/wQAVwReP3TMDH60lffAYY5i6h5n4ZtTzug8pLyADtEFCKh3TeB7Npbyfa4nUk98YZE TMSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PJwG5pFc; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-145749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145749-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cm21-20020a170906f59500b00a526a7a6428si1493446ejd.221.2024.04.15.16.06.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 16:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PJwG5pFc; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-145749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145749-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1A20E1F21161 for ; Mon, 15 Apr 2024 19:06:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03E82156255; Mon, 15 Apr 2024 19:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PJwG5pFc" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C23015623D for ; Mon, 15 Apr 2024 19:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713207983; cv=none; b=O/5YdjGW/QQDDh0leAuvSpfUm2nm9sOz5vYtRPfkB+1ls1uyU4vJBqi2iM8KeENgthXTuN5Z4ZbseCzT1BGPcZMP/gQZWiw342w0OdpaRFBzfPAadtoZyCajp6eGHxTd/fFkk0FgH4/K5PrD5y2ERChH7izY8FluDzI/2vnFH+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713207983; c=relaxed/simple; bh=dSGiT+xLSTcfM01u7Gve7gCnW5bf9/lDEjU/9A1y5w4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ForSwByQL0VPJvuYhQM3CpjslSPpbu36DMo4NaNDwcX6Shx9EPZx/ENKg7ro49+fT0vyzzczxePYu0Yc/sc7mpmQ4xBAAOhWZ0dgWUsbEG6LNWeySc6KWxhZzNIxpg3jcwqQgZkseuC3RTepOMr9GR1y3/NtVs31vPehl1lCbj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=PJwG5pFc; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MChLp9ws+slgrxOBUGCVsKZbu7NB1tpz2huFIgNyMUM=; b=PJwG5pFcev1RdMIj8qn6YK2j1U /X35JGgQp8HxsqhqFD9HoIdEnnIkypZpyZmXoJdWAWP/HFqGwg/n10lvoExA+pax2HMJO4WNxW8be gq/+xU3/ljtBvDcF5JKmNr9VimfwluKgVyBvqdVyDlnkT1WbkAgKky0UjJoVatMTpG5CRszweN9Jm Q4LpMJXidMN1e19z2I4zAWI5zor7mbeWFwuywTlnEj5q9Hv9D2E0MoUNZzRjM5lqTGOpnBsGStv5G GIpy4pq0CLYV6XkyOG0J0/nCLoc9wtpyz7GynB5/MJcwguZl6xDssMKJInwtYLJ4Fm50MTq1u2y9Q sjqbCS5w==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwReY-0000000GJeR-0OS5; Mon, 15 Apr 2024 19:06:06 +0000 Date: Mon, 15 Apr 2024 20:06:05 +0100 From: Matthew Wilcox To: Kairui Song Cc: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/4] lib/xarray: introduce a new helper xas_get_order Message-ID: References: <20240415171857.19244-1-ryncsn@gmail.com> <20240415171857.19244-4-ryncsn@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240415171857.19244-4-ryncsn@gmail.com> On Tue, Apr 16, 2024 at 01:18:55AM +0800, Kairui Song wrote: > /** > - * xa_get_order() - Get the order of an entry. > - * @xa: XArray. > - * @index: Index of the entry. > + * xas_get_order() - Get the order of an loaded entry after xas_load. I'd just leave that as "Get the order of an entry." as it doesn't have to be after calling xas_load(), it could be from any other operation that moves xas. Also this is the short description! > if (slot >= XA_CHUNK_SIZE) > break; > - if (!xa_is_sibling(xas.xa_node->slots[slot])) > + if (!xa_is_sibling(xas->xa_node->slots[slot])) Could you fold in this change I have locally? - if (!xa_is_sibling(xas->xa_node->slots[slot])) + if (!xa_is_sibling(xa_entry(xas.xa, xas.xa_node, slot))) That fixes a sparse warning which existed before your modifications.