Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp600103rdb; Fri, 26 Jan 2024 05:25:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9eJLzzfpo7MCEbfbJf26iiyOcLzwwncAmzt9BKaHJE3fdq3Gq7d+6Fnc6d0u7YwjEyir0 X-Received: by 2002:a05:6a21:3489:b0:19c:959c:f03d with SMTP id yo9-20020a056a21348900b0019c959cf03dmr14651pzb.101.1706275501617; Fri, 26 Jan 2024 05:25:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706275501; cv=pass; d=google.com; s=arc-20160816; b=vOP045oxMt+2q15tiUw+lCVKlleeuHtfRn+25HBUlBq2mcOjTQFmBmEf0S7QXKz/6v 6Cd13mO18ff8VjRAVizjUH9KjHPax0jqLkTWLPBI0u2pZTWz8f3RCZ84vww1o0j1h46e 1ucFIkTXRCIayoD+BR5SPt0N4DcFYZawunxfB1Lw0kYme/fSqTKrIQ548pa4mpF7hwLq vJ/hE8izEUGoo94S1sunGIhYOiURDMPOaOG3t4ARUBbZVaYwTwhRfm4Gpa5SgPG213t/ cXphl6YuPGyJmE97hfKq6JOBtK8fI863Y9GbVHaQ1/MQoNphoJb9Y+BriPHFUBgIaeJd //ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=5GztzeRJ7QonXydbXi0LYB9tRSovYETdbDIFz1v4Qmw=; fh=nmFgcoB2RcEL4hSl4YaJYzJRH/MNiD1zyCllZgsuFsg=; b=iRXqlUCznNPwTr6lduldb7tLNZOzdG8XvJ5Y9+okWNyWG1Zlu+NstujT0ktjZP4eaK xzoVbVetzzLOdqedgH0+sHlUBGtyGzRdSwEZe0Cjmw6oq2u7gHyn8J0pkZg8E84hxRwG syLMiMr44VwCfZ8R2x5EBBD1CoDAv1tLIlOAq+xItofvqtT2wjTaR4ISpyrJaCURclnI aba7PuFGSDF7Cg4VMnf4ya1B8F+8/KxsRFcHuQyjMrPE9NR4nwX+Jiv/wZzXLPJj2atF HUah9fNy9New9cSsATnzCLXMYQ+uuz+cN8B5i6Oqwy9Ot6wBlyCVMMU3FUhFfDtiMZb0 k/Iw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X3dPaX1k; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-40100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t13-20020a056a0021cd00b006d9d7c6b392si1159359pfj.270.2024.01.26.05.25.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 05:25:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X3dPaX1k; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-40100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 77DB4B2914B for ; Fri, 26 Jan 2024 12:52:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E39871B59E; Fri, 26 Jan 2024 12:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X3dPaX1k" Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 A95E51AACB; Fri, 26 Jan 2024 12:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706273546; cv=none; b=E22ewFTHnqiv2p76w8CB5CC/dB0VQjxRxUalJj1YZQw9VXTxcNV/eezL4HwCNYOnBSKg2lIZhiO3t0+BWqT4Mk7fIHAJan8CGDkkwV6eI3etMry3H50HcNMdUe6EUJqbyvfr0FMNlKBdS6fYoEL3FBvrvAFYiGqkK5pxSGXz3uY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706273546; c=relaxed/simple; bh=5GztzeRJ7QonXydbXi0LYB9tRSovYETdbDIFz1v4Qmw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ECQBWKVFVisRP7HfE/iCddW0ljlVkFbUSSeiZFmIflBd3FfaCcwMRT6ON/3N1XCuiaZrplKHYQhkIJGVwSZWgtpp6x9KiwgD09VEHpenniR/zua60xAQ/lOJmw0QZKwK8ILQr1hVsjTuhdpoO1vs4c8keqNXP7o3hGXDJTE5yYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X3dPaX1k; arc=none smtp.client-ip=209.85.219.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dc223463ee4so512969276.2; Fri, 26 Jan 2024 04:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706273543; x=1706878343; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5GztzeRJ7QonXydbXi0LYB9tRSovYETdbDIFz1v4Qmw=; b=X3dPaX1kU5zaWUFcAcAOVCIcookzalkK12TyPx6VDWOTpVGUPB/gE/2lrcSEDL7xpF 7grJ+gosUiJi8mM22t/bKossMnUVoWUF+LeB/KT7RWFD4yfPjUVb473EinXw8p18G63e h2nOYcHDBf/ny5gbw+TUHW8wInox5pze0AwAdV3P2sysQBTEJ0LPAq372INPRxbX8pwF V+Bk6LfktsNcLEXQh8fn11pHUz2RYcrpLGLKgp/O/DQuqZzuHuY/2zvgGvfAPIDCPlSE VtpjcrOp5YrGd17T0h00b60k1jFFplfIKWbMTom4rClPHu2C631nfF4Qxr0vGEtAGL/E 3Fiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706273543; x=1706878343; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5GztzeRJ7QonXydbXi0LYB9tRSovYETdbDIFz1v4Qmw=; b=BeD21kViSbaEtS+qLEhKEdgwKs6fGVbOPCahGKBtO5cCl/Z8tERR0UWsYYnR/OzSEf Kbf/TfBRShTNMHTV6C9K1M1/LiRFsdVgOGEz8B1tAeWNhLgfOS+5VEYxwSctJAXqM29i ND8976FHFbMSI4IQwLld9p4QdpBcZEWX36g0fDSp1ur/waPC6rfBhRN1XpHPp87rH2y2 G/Is1jyAdk2TOpNZYOM7/GgtGC51KN69bL54DFXrrxUi2kocGaug/j/16MR0OUy1/cXd n5nVQoYbgErqwXSRsTzOvs3pQPTNV2sOOJFs7u0SUjOSxLs9ntzUy5GbTH8nEn+KGTSr Jv/g== X-Gm-Message-State: AOJu0Yx6A6XIsJmdaWXrThazTILHsSbxyVOTWdCH/nhs2uuDVmrxlBuu t7pawZ1cz8/1CnpA2wjTd3G9FW4U9nMNSD7Qrix+nxJIAb+aTpo34KWgq/Ge4d2SDZ0tzitqwmR XYfS5sQMOoLYSE/0gwkPc650Outjn0VCpc1GDaSedlZk= X-Received: by 2002:a5b:f09:0:b0:dc6:3610:c344 with SMTP id x9-20020a5b0f09000000b00dc63610c344mr899970ybr.13.1706273543622; Fri, 26 Jan 2024 04:52:23 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240118120347.61817-1-ioworker0@gmail.com> In-Reply-To: From: Lance Yang Date: Fri, 26 Jan 2024 20:52:12 +0800 Message-ID: Subject: Re: [PATCH v2 1/1] mm/madvise: add MADV_F_COLLAPSE_LIGHT to process_madvise() To: akpm@linux-foundation.org, Michal Hocko , "Zach O'Keefe" , Yang Shi , David Hildenbrand Cc: songmuchun@bytedance.com, peterx@redhat.com, mknyszek@google.com, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024 at 6:15=E2=80=AFPM Lance Yang wr= ote: [...] > > If the kernel supports a more relaxed (opportunistic) > > MADV_COLLAPSE, we will modify the THP settings as follows: > > > > echo madvise >/sys/kernel/mm/transparent_hugepage/enabled > > echo madvise >/sys/kernel/mm/transparent_hugepage/defrag > > The correct THP settings should be: > echo always >/sys/kernel/mm/transparent_hugepage/enabled > echo madvise >/sys/kernel/mm/transparent_hugepage/defrag > Apologize for the confusion in my previous email. The third type of requirements prefers not to use huge pages at all. The correct THP settings should be: echo madvise >/sys/kernel/mm/transparent_hugepage/enabled echo defer+madvise >/sys/kernel/mm/transparent_hugepage/defrag > > > > Then, we will use process_madvise(MADV_COLLAPSE, xx_relaxed_flag) > > to address the requirements of the second type. [...]