From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-101.ptr.blmpb.com (sg-1-101.ptr.blmpb.com [118.26.132.101]) (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 0FA58275AE4 for ; Mon, 29 Dec 2025 12:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767011546; cv=none; b=P0rNAK4dwTCfwl1ssi5ugeDut/CwXjXJmk6ELQtCDd4TU7eHbAtKtHa2Ui/XmmomXsieB6CbuRlqTaAopmxf1WiytW+pT3KVVM6tMIpBzs5CEj5qJHJTVF41Lsf0I6eJNfJQ4kOGN5s8H/wv9LP3FWi4C/HdrCv3iKZZj6UUCOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767011546; c=relaxed/simple; bh=J0qmv1OgQBCE/sjRFsRP33TpZm4dJ+eWaM6F4Ezf2xk=; h=Cc:In-Reply-To:References:To:From:Content-Type:Subject:Date: Message-Id:Mime-Version; b=ZDAn7vaLZVFxsB9qfZ/d2HltHlHJj+mJI3ilsesrYGDW4MGtCadZ0sXNEC+6DXn9tFQgtjevpxM9LTpK+8fyPaQYYv8zn8bwqRWGmpwK5rIZ1svHclp2T5QNMVAReOjgq74VGDRox8q5EgRKahDOQlimSYYlR7DZ58tGcXCxO3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=WuZqxcWs; arc=none smtp.client-ip=118.26.132.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="WuZqxcWs" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1767011537; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=M4ciCLYxJpkt0+6+Q4lY4Pw69hjdYqXiZ08i183ZErc=; b=WuZqxcWsXgpmxVtQHA088Bbz9tDw7fu1cwxx+6AuU0koAN/FROHqKZKFgX62gJvwmkQkfL R3nTzNO6EL9dTTTcQQpioMxQj2cY8ykg+l+hK4Ehy1TARtSNJ5FmLaUXBFcyzIYFmLkXty CKPH9oaa1kqsIzE1FZ7gtGhU1DlPds4ZZN2GJzcmFcOZrpN0Ji8rmjQ6WX5UjMiGS68RQy o1zHuvsn/SKBchhrqI+h0suUvthX53vcqQSmbH86Z5ln93lmXCFzhZ0pw3Tczq9C1Yqgv/ eiRKfK/0BW+u4rHZOahbGjLq+shnclkK26oRmXlnXogFEu2mo1tP9t9g5T7S5w== Cc: , , , , , , , X-Mailer: git-send-email 2.45.2 In-Reply-To: References: X-Lms-Return-Path: To: From: "Li Zhe" X-Original-From: Li Zhe Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH 0/8] Introduce a huge-page pre-zeroing mechanism Date: Mon, 29 Dec 2025 20:31:53 +0800 Message-Id: <20251229123153.7578-1-lizhe.67@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit On Sat, 27 Dec 2025 08:21:16 +0100, mjguzik@gmail.com wrote: > In the name of "provide tools, not policy" making userspace call the > shots is the right approach, which I advocated for in the original > thread. Thank you for your endorsement! > I do have concerns about the specific interface as I think it is a > little too limited. > > Suppose vastly different deployments with different needs. For example > one may want to keep at least n pages ready to use, RAM permitting. > > At the same time it perhaps would like to balance CPU usage vs other > tasks, so for example it would control parallelism based on observed > churn rate. > > So a toolset I would consider viable would need to provide an extensible > interface to future-proof it. > > As for an immediate need not met with the current patchset, there is no > configurable threshold for free zeroed page count to generate a wake up. > > I suspect a bunch of ioctls would be needed here. > > I don't know if sysfs is viable at all for this. Worst case a device (or > a set of per-node devices) can be created with the same goal. In my view, the present kernel framework does not allow an ioctl interface to be placed under the per-node huge-page directories. The functionality you describe appears to align closely with that offered by the cgroup.event_control interface in the memory controller. We could therefore introduce a new event_control file for huge-page events, following the same pattern. Given that all huge-page attributes already live in sysfs, such an addition would keep the interface consistent and avoid the extra indirection of a new /dev/hugepagectl file. Thanks, Zhe