From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C1F3633555F for ; Mon, 13 Jul 2026 16:13:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783959230; cv=none; b=he7mUhU6rrubtvdnpFbC+bBhIBiYkQd9u4R9GPjSlDZyZr/7WapexKdPtw24N9R9eZkSnB1bkH/tzDwT1rgahsdvPr4UQwIcDa7US9Hu43RTQTHFakSx00WsXGVqrs1JgQOPr3ABIsKmYVsEnUk4O49sHGUUiBH0+V64hhukty4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783959230; c=relaxed/simple; bh=eJ1EUe28xMmaOJ4JQ9huAuw0uvL6kWzfIroejOfu0GE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mQCfiixouIY0p7mkn80HNhGgr9aAuI3ts5Va5cSXhOnPfKo44ipg8NL76FFAetGM7VwKidDWRvA2rWRxjvAyTNY/FBQ4ORzJuZJ6ORSUPLLL9BMtPoFypMznaPdynql6odQHmGVMHj2r8COzg+t1xWjau1wNw9nx1XeAqgZyvAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hmDPBYv6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hmDPBYv6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2BD51F000E9; Mon, 13 Jul 2026 16:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783959228; bh=0ggLaQyM5HWvBPO+q9EAN9S5KITVNDf38aQ4yiSX9v4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=hmDPBYv6lYb6rD1tAjX0/MlpQY37ID88BRPfLYeEmA4+NmZDwxmgNMHdrrlxBcZ2W my0/u17CQENYcRbDHFY+kiiwzK2dPp4Xabp7hH4DHDT9NF7cNFrDzZuQzdw9osIOgu 9VxIx52ge/CSbkavQ6iBAoP5Ucr5vsLe+suvZoJBmJ/clxU1KEzZ8zg+YgChOA4E7y /gLfA0Bo4BUDpWT+ZX1w9p96OFs5gyw9zMyWi0s75ibt6acgwUKF3kvE8Bsj9J8yYl xzQ7+teqjy5PXpzvYW3YVdkipm9T8a1qqHjNvme0+iUXuuYx8JaI2SDp4WtSBxktkb X8h/1DmKjvW2A== Date: Mon, 13 Jul 2026 17:13:35 +0100 From: "Lorenzo Stoakes (ARM)" To: xu.xin16@zte.com.cn Cc: akpm@linux-foundation.org, david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, baohua@kernel.org, lance.yang@linux.dev, usama.arif@linux.dev, chengming.zhou@linux.dev, qi.zheng@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, wang.yaxin@zte.com.cn Subject: Re: [PATCH v2 2/2] mm/mm_slot.h: clean up macro parameter names in mm_slot_lookup() and mm_slot_insert() Message-ID: References: <20260713143534964Cml5-QLfcPMDtbbq_j7tG@zte.com.cn> <20260713144153556amKkr4s-dWoQu5-ziCfZe@zte.com.cn> 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: <20260713144153556amKkr4s-dWoQu5-ziCfZe@zte.com.cn> On Mon, Jul 13, 2026 at 02:41:53PM +0800, xu.xin16@zte.com.cn wrote: > From: xu xin > Obv. as others have noted, you're missing a commit message here :) > Suggested-by: Lorenzo Stoakes Hmm not sure I suggested adding a comment to explain it... or removing the prefix _ from the existing macros :P > Signed-off-by: xu xin Honestly I don't think this is really adding much, but I guess adding the comment can't hurt. > --- > mm/mm_slot.h | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/mm/mm_slot.h b/mm/mm_slot.h > index 5de3e91d86b4..710c70166c79 100644 > --- a/mm/mm_slot.h > +++ b/mm/mm_slot.h > @@ -33,12 +33,17 @@ static inline void mm_slot_free(struct kmem_cache *cache, void *objp) > kmem_cache_free(cache, objp); > } > > -#define mm_slot_lookup(_hashtable, _mm) \ > +/* > + * Note: mm_slot_lookup and mm_slot_insert cannot be converted to static inline > + * functions because hash_for_each_possible relys on the actual array argument > + * 'hashtable' for sizeof() instead of pointers. > + */ I didn't say that you should change the _macros_ to drop the underscores though, there could be some nasty macro hygiene issue without (though probably something's broken if that does happen). So let's not do that. Also you'd probably want this comment above both with a newline after so it doesn't just seem attached to mm_slot_lookup() :) > +#define mm_slot_lookup(hashtable, mm) \ > ({ \ > struct mm_slot *tmp_slot, *mm_slot = NULL; \ > \ > - hash_for_each_possible(_hashtable, tmp_slot, hash, (unsigned long)_mm) \ > - if (_mm == tmp_slot->mm) { \ > + hash_for_each_possible(hashtable, tmp_slot, hash, (unsigned long)mm) \ > + if (mm == tmp_slot->mm) { \ > mm_slot = tmp_slot; \ > break; \ > } \ > @@ -46,10 +51,10 @@ static inline void mm_slot_free(struct kmem_cache *cache, void *objp) > mm_slot; \ > }) > > -#define mm_slot_insert(_hashtable, _mm, _mm_slot) \ > +#define mm_slot_insert(hashtable, mm, mm_slot) \ > ({ \ > - _mm_slot->mm = _mm; \ > - hash_add(_hashtable, &_mm_slot->hash, (unsigned long)_mm); \ > + mm_slot->mm = mm; \ > + hash_add(hashtable, &mm_slot->hash, (unsigned long)mm); \ > }) > > static inline void mm_slot_remove(struct mm_slot *slot) > -- > 2.25.1 I think maybe we should just drop this patch altogether and stick with the first patch only. Cheers, Lorenzo