Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1358556rdb; Tue, 30 Jan 2024 16:41:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUYDBHagxEQESfxRsi903eT8B+TS8lGQfqAUUUALmmtAvvPzWqv9sx81SCTdsglPtKy5/7 X-Received: by 2002:a17:906:5ad3:b0:a36:6e1e:2516 with SMTP id x19-20020a1709065ad300b00a366e1e2516mr17109ejs.70.1706661712766; Tue, 30 Jan 2024 16:41:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706661712; cv=pass; d=google.com; s=arc-20160816; b=QFYSBK7Cwp44amTT/YzGIdgbQbJdHGyOR23yTMlDKdAJFklLTOwCIhjSSrmXMLM8iM PxftDumXHERhDKuFIYFvIdqTpH87FO6NR7/iTMQTmLyW+Xpv4/9TYNzes6dGLK7zxxje hTWR2gD9Brie6+CQroCQSm0rKjVDRy+NuRxccngb1Y5ziL657/xw+Yc0aasGpffMKYMl 7YXev5lwfdpYnXM0L7/ReSSTGGvyCJWKHKBhqP4KwlQIVrhGwXto/mT2dp/6fquIbBwl Swy4UooS0cu/4KOS1VApcgobdrxdTgux2PrERV63Wk4DUxZhTpaRrEjh3++IaMZxa6xM NQAA== 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=zeylMOsdJd/dJk76pyz8wAk5p6kMqJH/DY8gjEqi2II=; fh=ioFOBhWwwnXHC04qVjd0/sUQ4nHe9Eo22/ckEQcppFc=; b=N0bw+WclcGMEBhqwcUUfG4qqBdvMZZaa0MRT5EEoGtDm/ynRhdAB/Ld6+z8J4okH3Q mTakBy1piDH2nZUvgcHUiaN2Sz8zkyqmfVYVYL3yAWx7ZyRQYKy0iUUmFEZflCOLfRUA DGfhU6ojTTFF83beyODxHqjL4a+b7f6aAefRmaR0gpbzgpd5IM0skDXmHmS4OToKH5fC H8XJJjEhHZbqm4l0V4Mn0VbsuUOQM49atck5l9VOee8+X7LWzXkm2Hc8Ww0LqIur7d06 Ne4GWTZXrbMHMPjhtumRbBDZR8E8waKIzu5IAcJBr06JY4OD3ybmH1G5OP345iVqY5Q/ o49g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ddCKysz5; 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-45536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCVLaXRZg1WjuhGLQ40/abGOgZ246FN6DeAITkJERQDlO+ec2zqazACtZuRUpuroSpoHJBj1kl5CT7fbgH5BPm0P4Zns1mFHw8X6pQtsjg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g26-20020a170906199a00b00a3192f55d6asi5027183ejd.1041.2024.01.30.16.41.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 16:41:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45536-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=ddCKysz5; 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-45536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45536-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 E89FE1F26B5A for ; Wed, 31 Jan 2024 00:41:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE53D38392; Wed, 31 Jan 2024 00:37:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ddCKysz5" Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (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 577FF364AE for ; Wed, 31 Jan 2024 00:37:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706661453; cv=none; b=RKZCcXwKz7BOctSADA5V6RVxIYpPVQ7zbB357vsgdcrspA9XfQNPasMVkown2g7DgxUy+WYK2hwD6CVyUK0QceK7jOcOiJ696bAmFr9buKMgKx5TSGoebzxLsFj9/1cia2NesUmiQfmYD7XGxIjCuIJGLE82FbKXk+Pl58sdd8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706661453; c=relaxed/simple; bh=zeylMOsdJd/dJk76pyz8wAk5p6kMqJH/DY8gjEqi2II=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LcTBGmD39HDupDeAA1FfAJrF/GcAyzwPIGnOAj0vBsztIdI8vUlrzfcaqxtm/o209+Mvd4DqnvsMgQ/cdUWBE34gvG60DKywpbMBmVTqmk0D6JZgkhVoMjvSRCd2lsLboPNgNITbUvPaiDoMzvXwdOrhpcMnYTf7KqPcKOvaXX4= 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=ddCKysz5; arc=none smtp.client-ip=209.85.128.179 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-f179.google.com with SMTP id 00721157ae682-6040a879e1eso2446417b3.3 for ; Tue, 30 Jan 2024 16:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706661451; x=1707266251; 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=zeylMOsdJd/dJk76pyz8wAk5p6kMqJH/DY8gjEqi2II=; b=ddCKysz5adpJoHFEcjmdv+SYQQeGTT6xKR9Ax3BbU0hknu1+vYOGqrP9maJXcSWT63 RkNz+T5MWx+HAiMCJd+XoVtNyjRlgB+wyu6m1L0jffM8DAcJjjW2tv1cJJf5toDHFgkl RAFqVEZrgWzYEWJs1vzVfxWYqxSIv/v4ajM6dGLMkN3BNqRYxSNgP7wz0AQqmtiXvG7W eFYtxODhN3141sN9P3JBQHEsppIEbA7sP4Hz84zbg20mZH2DaW38hJqPbiEDclEIKWsH zfwJ2V2/9L2E630snrlrTz1qUSoTrAApx+z3RIV65M6j/5g8nhskemTlVIQKilqjfI8A 5QmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706661451; x=1707266251; 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=zeylMOsdJd/dJk76pyz8wAk5p6kMqJH/DY8gjEqi2II=; b=fHcLuNAC275hHrcDbGypphrG7xBA1f5/sqV57/9oriHz2+73C+OuCp4/XnqrMwN+5v V6f3lVXiXxrVhrO3junMOu5ue1KioIDt911/APYamZ8SQMh6+3e9VhgIBoN7QP/YUo5K LfacplY76Xrc8iXGqhnRb9NxFTbZzhAI+wYZnQCzPc7Sbu389hQvNt90huipDoyj4scz rJJpzfDSsJdcg7JZEr5bV+KL2P5yybcAi9YwwL0HWULb9RJDAROKr7AVCZcg3mveho5k 3fmMyRmF8pTLtbjvRy/0bXeSAHBHfmO4DZK+XjmqjmyFwOrHs3aBINI87bXYCa/80y69 QgaQ== X-Gm-Message-State: AOJu0YyTZPVSMtGqpc+qm564PfUIa3dpnLfvIwsxGwmGdUzH9XGSQhFq MWXAS1HOvluY87E8O4eiI56H2Ru7OAoA6ubduyZw3M4t5NAG+qTaLJVowWfVYJJeQq/Lxb4vR2v qfYRqtOIoW+TjOn0OE+mDDLWGIfA= X-Received: by 2002:a25:83cd:0:b0:dc2:4468:d4ae with SMTP id v13-20020a2583cd000000b00dc24468d4aemr213462ybm.57.1706661451256; Tue, 30 Jan 2024 16:37:31 -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: Wed, 31 Jan 2024 08:37:20 +0800 Message-ID: Subject: Re: [PATCH 1/1] mm/khugepaged: bypassing unnecessary scans with MMF_DISABLE_THP check To: Michal Hocko , "Zach O'Keefe" , Yang Shi Cc: akpm@linux-foundation.org, david@redhat.com, songmuchun@bytedance.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 Hey Zach and Yang, Could I start a new version? Thanks, Lance On Tue, Jan 30, 2024 at 5:46=E2=80=AFPM Lance Yang wr= ote: > > On Tue, Jan 30, 2024 at 5:35=E2=80=AFPM Michal Hocko wr= ote: > > > > 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