From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (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 A1BC53093A6 for ; Wed, 20 May 2026 10:30:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779273041; cv=none; b=P6Flx4XBBg/ByuD7uW83ydjaGA6GwbMK8FYfS7H2vHscn0mVeiTpkgbo3lYyLfCSH9R2wyLLpk8cXYfNypTh9zNjRuk3ve9dTnpHcmdBCLRCdiUNz8tbRpO3EgZxY4aJEvvdYX65B9qk6BZpFpH3oQAmmMgGtjk4K0qP6U/x1Rk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779273041; c=relaxed/simple; bh=Wk2IDpSQjXogCYpG6qpkMlv9jwsuoFtcfZLoHOaRiK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RzHu124UAmAt2D+6/N1ei3FHqcGS/pCO6WF1UXTahfoCMdu8jGxzzvH2jRBt54EDykYMGgq0lllcQ5nk25TkI+xgLRvK87FaiVwR/gAYENvgbe5TWc9SNDYNqPtXv+XIsFjanF8m0BuhZgRBmcRAiV2HYHX66xQlVKcQ0TNfpMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=CgrIDFsw; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="CgrIDFsw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=Js hG2Rkio5xP3P8RtvD6kIRCzkBOc2Y2DUQP7ru9HaA=; b=CgrIDFswdbzn8/6Ly/ jTgzcJwAEfYKTPDAf2td30MqdJ3ksrhbm2g6Ak99rf9BpTB3dJlEuxpOejXOcXr1 23nyGlqHW1RSof5RPeThlisanH5AbBfjUjkd+VVKHtmgd5r6S1Y+zX0cqZJhZa1T +tz1KHkj4tyDFiIzgS9ZiG7pk= Received: from ubuntu24-z.. (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wDHP1wDjQ1qJB6rCg--.37309S2; Wed, 20 May 2026 18:29:24 +0800 (CST) From: ranxiaokai627@163.com To: akpm@linux-foundation.org Cc: baolin.wang@linux.alibaba.com, hughd@google.com, leitao@debian.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org, ran.xiaokai@zte.com.cn, ranxiaokai627@163.com Subject: Re: [PATCH v2 1/2] mm: huge_memory: refactor thpsize_shmem_enabled_store() with sysfs_match_string() Date: Wed, 20 May 2026 10:29:22 +0000 Message-ID: <20260520102922.63737-1-ranxiaokai627@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260518110816.79be9a7c71777c1876b0019d@linux-foundation.org> References: <20260518110816.79be9a7c71777c1876b0019d@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wDHP1wDjQ1qJB6rCg--.37309S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7JFyUAF1rtFW5Jw1DZr47Arb_yoW3Grb_W3 WUX3sYkr1DJw4kJF4kWF4jyrs7Gayktrn0qayIgrn8Was3X3s8XrZagr9ay3WrXFWxWFs8 GFy5XrZIgasIqjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRCxRDUUUUUU== X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/xtbC7QVCjmoNjQUqmQAA34 >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. David also mentioned this optimization here: https://lore.kernel.org/all/4f2abf42-983f-4cc2-92f5-c81827e7b7e2@kernel.org/