Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp899023rdb; Tue, 30 Jan 2024 01:47:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEp37cF3PD6RKt9YebTe7ZdYhjycycvp8grALy+t5jZLJeWsPtkbEzh1FM/yYJQlm7yLkBP X-Received: by 2002:a17:906:c091:b0:a31:7c5a:bf5b with SMTP id f17-20020a170906c09100b00a317c5abf5bmr6274048ejz.5.1706608038966; Tue, 30 Jan 2024 01:47:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706608038; cv=pass; d=google.com; s=arc-20160816; b=yTCQYZle7S8qMuRpbJux849f0ZC2OYg/+LLcO6B1tr2o/73Yy/kJuYwpeZWWrRCqjQ Fby+WBTeERn8isOlq/Lwb7POlcoZ/aX+mS8fpkw39imCHNBznwwN3hK1kc9yaLrE5dvr yWapQ+KNT88p99F+EfTjCu1O88zg+zjn1z8FuabLOUSCEhjUAgDgUuo7t5bIn0g+xYZj Fvv4pHF4rOcljfkKDE87yLfr5AoTvbrfRglHc0UfY+JLkSG7oJlMVVD0Bai/Riij7TIM 8XYxrZ74PvuHt4mc+wHUyi4/WIiQb0l/5Y0H3oc8/ZtjRMD8bX3wZEdJnnkWD1t+W5aN b6LQ== 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=gb2HjwEa0C8yF0X/vBJtNDEd4ZBIosdsqR7MEMmpMJI=; fh=+LmA/NZ3YXeQtzy0/2OuZZJHr3Yy7laU9zVutxVXZE8=; b=ZApFn5ZR/u0w4TX4rIrfr2p9NPJ6/0Bg1oQqr8hbJRmZVMJffKBgoTy6kZ5Q0Sxjp4 aI+NGp18JW9Nq+sHGvyd2ZOVELr5cOWFJ14Id030dNC3nSCk6dQHYfmJW6cS+gygrI3y 9IXksoLUeRM3wlnkE+N8TnuYEKOrmA1KGSMkEy6L1vyy1Pm8akWE0tHCkDjmWhPmT3yX DcH1D0OHBWx8SlwKg/xlZRMneSBK188NbAgXpWqpNKHFHtAPl1q6Z8i/0Y+wXEmp0z/5 tQgGrJxgjq4YlXQvA1NfKoBEAdCESXMjtdnKK3RLS77aysDk+Gl1AU7KRTToohElAeGi x2nA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=leh6T7Ek; 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-44289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ks19-20020a170906f85300b00a33b00b4a95si4521859ejb.218.2024.01.30.01.47.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 01:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=leh6T7Ek; 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-44289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44289-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 470F01F26F98 for ; Tue, 30 Jan 2024 09:46:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA6AF605C1; Tue, 30 Jan 2024 09:46:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="leh6T7Ek" Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 96F0D38DEC for ; Tue, 30 Jan 2024 09:46:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607991; cv=none; b=JUNUOsCglydaQwrPl4MNMWBirOj0MDtk1vt3S3z+DHWuw8tU6IY4i423VfhI6Zk8dEdJmY73pGe6Hm19Ykl8xgxkDcAE5t7zP6M540nkyyPpUkK7U0Y0MtQRxEdw9UVaUrZy9FB5E5aGb5Dan0MwJ2/WHBaNGTsCNnz6lUnLvfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607991; c=relaxed/simple; bh=gb2HjwEa0C8yF0X/vBJtNDEd4ZBIosdsqR7MEMmpMJI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=g6Gm0g48DZHoLLZFcaMaGVqclS7081H5K2WouThEEgYCHUfmHbT3TjSiK0pBPACrzQxTWVoMg6EE0v/oyq4F3o3vRT37bGt63EcA9AXuDzXIojbYRgrd4ZM6Gze3k3fi4wJvKbIbAG/DxeZvExtHyZfT/qV4J/+q8QDohqsxLRE= 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=leh6T7Ek; arc=none smtp.client-ip=209.85.128.174 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-yw1-f174.google.com with SMTP id 00721157ae682-5ff821b9acfso36103387b3.1 for ; Tue, 30 Jan 2024 01:46:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706607988; x=1707212788; 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=gb2HjwEa0C8yF0X/vBJtNDEd4ZBIosdsqR7MEMmpMJI=; b=leh6T7Ekt2SKdHOF7tvf9on187uAdXv8WgYRau1CNGbr2tSIXnQ0jC/XawGJw+vlid aJoFkYDIJ8XV8tvVwMCM+Uaz/iyVNrjICIQG0MMmtng9tR1BGJhcSizTNWeN3YwIRwVa gD84VX1HUnCrEL8DXIlgA0RT52wt5In+2h5HCZFcoJgRE0b+TcTY/GJJahs01FllyuNI uEfTpL8N+I0TdVygWZNpROLi311dSYvS8BbvOGvLNH+U4GmL9BPrG8qb9/xNbkmN11bn GCq1VDNw288Y2grA3Y75Xmn/bTvgv4PF5TDNQZO+UK0i9w7EXEWayGuhnrXkiLeP2eY8 OEww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706607988; x=1707212788; 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=gb2HjwEa0C8yF0X/vBJtNDEd4ZBIosdsqR7MEMmpMJI=; b=wrW7R7GTf8yif6jCTSVRfjMVnigohi6siPq+4ijK86c1qKnJzNbESO1whJ/6g4K6WK Hs4mpAtMD4EJ+LkWe9XXczwv/hurONXIQdJ2CmkMGo0KgfryQPufc3Tx460zOTMU6fUJ Mq/zdWdEa6w3Gevm5vYG+FhfBcw1D6J+Zsoz3JojWqmB1szh5nZmxRs7uwHURNOTQOeP IVs9qn/mmXvvtfBEj7bLUx1PmAkZIBJPiP29yWC+5aWN6yAmqLGihIwoF64HnM3ad1mI QLa429P1+58RsS8Gux7PsJDvFscFvzBIkSbWcRLJrmWXC7JoPcyNQvkPMFTgl1vehUWL pSAQ== X-Gm-Message-State: AOJu0YyYlZ4sAojgShnGh1TNk4uqQ5x8409eZr0StSiZg+Yj5I4wMIiP sdhkupYKLo23g8aIqynE3DG2wDbkE19OOml3OORTJSZjhEkW/yO3CbDdQAhNMU6U+5BuFXN9RTc CZdvl2sItdXYFOX4NzVMTma24q20= X-Received: by 2002:a05:6902:18a:b0:dc6:19ea:9204 with SMTP id t10-20020a056902018a00b00dc619ea9204mr3893891ybh.61.1706607988559; Tue, 30 Jan 2024 01:46:28 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240129054551.57728-1-ioworker0@gmail.com> In-Reply-To: From: Lance Yang Date: Tue, 30 Jan 2024 17:46:17 +0800 Message-ID: Subject: Re: [PATCH 1/1] mm/khugepaged: bypassing unnecessary scans with MMF_DISABLE_THP check To: Michal Hocko Cc: akpm@linux-foundation.org, zokeefe@google.com, david@redhat.com, songmuchun@bytedance.com, shy828301@gmail.com, peterx@redhat.com, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 30, 2024 at 5:35=E2=80=AFPM Michal Hocko wrot= e: > > On Tue 30-01-24 11:08:10, Lance Yang wrote: > > On Tue, Jan 30, 2024 at 10:12=E2=80=AFAM Lance Yang wrote: > > > > > > Hey Michal, > > > > > > Thanks for taking time to review! > > > > > > On some servers within our company, we deploy a > > > daemon responsible for monitoring and updating > > > local applications. Some applications prefer not to > > > use THP, so the daemon calls prctl to disable THP > > > before fork/exec. Conversely, for other applications, > > > the daemon calls prctl to enable THP before fork/exec. > > > > > > Ideally, the daemon should invoke prctl after the fork, > > > but its current implementation follows the described > > > approach. > > > > In the Go standard library, there is no direct encapsulation > > of the fork system call. Instead, fork and execve are > > combined into one through syscall.ForkExec. > > OK, this is an important detail. Something that should be a part > of the chnagelog. It is also important to note that this is not > a correctness issue but rather an optimization to save expensive > checks on each VMA when userspace cannot prctl itself before spawning > into the new process. Thanks for pointing that out! I'll include it in the changelog. Good to know it's an optimization rather than a correctness issue. Thanks, Lance > -- > Michal Hocko > SUSE Labs