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 AFECE394464 for ; Fri, 22 May 2026 13:04:07 +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=1779455048; cv=none; b=ds6F2rHjNWzrWQBEpxvQ2QUD+uzegdAZ32RwpvfW5rhPWg4KBRNtvqVna7xQSQ8hRBjN9bavayWaqRcAIlHfjFCRjoipul0SOBsBGAELkMKXnWlEoKdP0CqulpZWjisNxIRk3e/U18ewCRDC7TQHI1NtwhD9712a6dWfLv1qznE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779455048; c=relaxed/simple; bh=W2BWP1Xf2wJrixlqxMvdDvl7t2ElwXF3J4adT0rAnfU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G5kaDbl/sK5/3C1YkMQqDcpfOrU5ramTYjUCWtHqMnv5VpAZANEJW4/5jwbEgyeWYooywtzvDUBW1v1RJJjqN7GWFGuyH/BGt/u1KsPmBB0bUpXZHkaR7fUzhzT+u/U6vPF5AZRghlXlXWxZwJfpLZyspvzTIcySURwO4T+x4BM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M3xCeJyx; 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="M3xCeJyx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 905151F000E9; Fri, 22 May 2026 13:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779455047; bh=O03EFqY40yr84NHmdTZsOIzc8gUdPk222HuMfERftx0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=M3xCeJyxC374t2syxCskrtuPvHfNZvR/I4iyLwMEsBtz/zttNVyoZ9ptm2tKNYIxN GR9DbP8QXbXo7LTCARFObUPM+hJIGLuDCJVkzdNURIlY5hiOYGPI1cS69zU39QWf0X LqnOijrOX2t9wtLnJplVBkY4I1RbWGVYH2JdE/X+C79IsPBq4Ruh0pTBOWCLjDl2eA DLXY3SvkoKyAULHBwASeZjoFVEp3N+OIIYY/WGI8h6D92TyDNj8oXnFC21el3csVT1 1Pr5Hnsu13Yx4GtRLEbx0LCV0jFweJpYKi1MPv49cMVKNbz0fwrXdlOto5iUrjjCwk vEapF2nyQa4lA== Date: Fri, 22 May 2026 14:04:02 +0100 From: Lorenzo Stoakes To: ranxiaokai627@163.com Cc: akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, hughd@google.com, leitao@debian.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ran.xiaokai@zte.com.cn Subject: Re: [PATCH v2 1/2] mm: huge_memory: refactor thpsize_shmem_enabled_store() with sysfs_match_string() Message-ID: References: <20260518110816.79be9a7c71777c1876b0019d@linux-foundation.org> <20260520102922.63737-1-ranxiaokai627@163.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: <20260520102922.63737-1-ranxiaokai627@163.com> On Wed, May 20, 2026 at 10:29:22AM +0000, ranxiaokai627@163.com wrote: > >On Thu, 14 May 2026 09:26:39 +0000 ranxiaokai627@163.com wrote: > > > >> Thanks for the detailed and thoughtful review! I'll fix this as > >> suggested in the next version. > > > >AI review is asking about a couple of atomicity issues - please check it out? > > https://sashiko.dev/#/patchset/20260513094508.50888-1-ranxiaokai627@163.com > > The huge_shmem_orders_xxx global variables are of type unsigned long, > which is 32-bit even on 32-bit systems. There is no reason for the > store in __test_and_set_bit() to be split into two instructions, > so I do not think this introduces a torn write issue. Yep agreed, this doesn't look like a real issue. > > David also mentioned this optimization here: > https://lore.kernel.org/all/4f2abf42-983f-4cc2-92f5-c81827e7b7e2@kernel.org/ > Yup, I think it's fine as is! Thanks, Lorenzo