From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5662C6FA82 for ; Wed, 28 Sep 2022 08:36:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D288A8E0133; Wed, 28 Sep 2022 04:36:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD8CE8E0120; Wed, 28 Sep 2022 04:36:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA0CE8E0133; Wed, 28 Sep 2022 04:36:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id ABA048E0120 for ; Wed, 28 Sep 2022 04:36:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7E728A118C for ; Wed, 28 Sep 2022 08:36:25 +0000 (UTC) X-FDA: 79960837530.08.1C93EB9 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by imf19.hostedemail.com (Postfix) with ESMTP id 15B1F1A000A for ; Wed, 28 Sep 2022 08:36:24 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id y136so11940961pfb.3 for ; Wed, 28 Sep 2022 01:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=uwSOve/81KIYjst9n3pRzNvaQgmpZogrRPtc/KOwrbY=; b=fVdLIjCzXskYCPFBD7V4kHnhC3YY9gmFDy66aJl80T2WgiPe/7Hi+MfBtayhy+WqL3 Tzk/Edsy1ghw5D0K6w5Bzfqhh4ts9yfprsNZVdsbY45L9ai9CBbPnkucK3/tVkv5nFDN AV3SeWrM90xe6swRhTSqLavbOG5qKsrT43fFBicfeEOlYV7PWtXZoZlGjQAltUXPMUEf unDLtZ/cx3ni9i9gAOb/2Sg03j3oPSzefOpYvJSpyIalKoqINrdpHL9uqKnJj/sU8jtb L06uoo5v5cjHcKGhj1OaUBg9FTpqzLmSpuDTWS25611Dl80jTfLLeGJSlSty1xgd9RWK 3qfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=uwSOve/81KIYjst9n3pRzNvaQgmpZogrRPtc/KOwrbY=; b=Ib6vgW7deHDCDPoIgmYV0aShEpT73br3kNrQp7DykQ7VWT4XPn1rzXLNIqbseesBSI EjnmyfQDEjDwi2t96IyRyE4ZOf+UHnmj0qqjTyX/EyDdk1sFT+zzEBXSBkZ42M7TmIDm 7Gn7OrHBIUDzwvG7slCDXtGKL0lzj9hndT2mznwN5VXbVu76Oo+fqLsnEQsp31y1e26I /XlGBOYAJ0JZoZ8RTmmnQTSD4XnKa8qEGQZUZf22CNssznLT0mFN4uzplindtPZIkxJc Pk32Yjio5ipNdsGc5HxthVdPbWyeGJl5iG9k9xz2PRWKh71ci1WNFdxnei2qK48ydnCv OqEQ== X-Gm-Message-State: ACrzQf2HGF0n8xAFS+fDvG7m/gzAdOSLaIa5ZD0B30ySPlSsVa74IHxg Kce+Sd+fmsJ5q+viwx+KDhk= X-Google-Smtp-Source: AMsMyM4ZQHWSb1aqIiBySy0Xbx9HGL0uAAjV9wv/7Ewg+qbpNrsajGsi6IckX04ALplBhcmHudrfmg== X-Received: by 2002:a63:4a20:0:b0:43c:428d:1783 with SMTP id x32-20020a634a20000000b0043c428d1783mr23129554pga.189.1664354183850; Wed, 28 Sep 2022 01:36:23 -0700 (PDT) Received: from strix-laptop (2001-b011-20e0-1b32-d148-19d6-82fa-6094.dynamic-ip6.hinet.net. [2001:b011:20e0:1b32:d148:19d6:82fa:6094]) by smtp.gmail.com with ESMTPSA id p17-20020a170902e75100b00179eaf275d5sm3067951plf.27.2022.09.28.01.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 01:36:23 -0700 (PDT) Date: Wed, 28 Sep 2022 16:36:15 +0800 From: Chih-En Lin To: John Hubbard Cc: Andrew Morton , Qi Zheng , David Hildenbrand , Matthew Wilcox , Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Luis Chamberlain , Kees Cook , Iurii Zaikin , Vlastimil Babka , William Kucharski , "Kirill A . Shutemov" , Peter Xu , Suren Baghdasaryan , Arnd Bergmann , Tong Tiangen , Pasha Tatashin , Li kunyu , Nadav Amit , Anshuman Khandual , Minchan Kim , Yang Shi , Song Liu , Miaohe Lin , Thomas Gleixner , Sebastian Andrzej Siewior , Andy Lutomirski , Fenghua Yu , Dinglan Peng , Pedro Fonseca , Jim Huang , Huichun Feng Subject: Re: [RFC PATCH v2 2/9] mm: pgtable: Add sysctl to enable COW PTE Message-ID: References: <20220927162957.270460-1-shiyn.lin@gmail.com> <20220927162957.270460-3-shiyn.lin@gmail.com> <7db06e3d-5e00-2b8e-ea46-fbcdb82c4416@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7db06e3d-5e00-2b8e-ea46-fbcdb82c4416@nvidia.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664354185; a=rsa-sha256; cv=none; b=pUC6+yif5Z5ma/E4ft7qWjMhGC8o5DsK/wJGWr2/MTT+SffWOgPls+oiqPP1bCziL7wwvX dr+uK5SG0Ob41JF9XSs/j/Mqoa/IPb8XqC4uklRlbAlwKWRob7SBGDqoTRAdTcnFwyZOdg 3AaWnZooh7I/89aNp+/K8pmmimN3L4c= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fVdLIjCz; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of shiyn.lin@gmail.com designates 209.85.210.170 as permitted sender) smtp.mailfrom=shiyn.lin@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664354185; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uwSOve/81KIYjst9n3pRzNvaQgmpZogrRPtc/KOwrbY=; b=ggSg88g1SGtRNZeYPtyePiDK9epoPn3Z4/WmXrfRfL0aq8ucnx3yFYR6je6KKDtVHn6PjP j4lozuH3+YQIY15GmzhEDIdldJOkSy+PxTjHbO+RC1AseLvr67tguixhzX6OcD3zX81gNG Qm4VeFQ3weqBPH7oSi0ifq9H1Wo10eQ= Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fVdLIjCz; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of shiyn.lin@gmail.com designates 209.85.210.170 as permitted sender) smtp.mailfrom=shiyn.lin@gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 15B1F1A000A X-Stat-Signature: gx7jcezor1dyp77ofip8fuhpxwhq7o3a X-Rspam-User: X-HE-Tag: 1664354184-935306 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Sep 27, 2022 at 02:22:27PM -0700, John Hubbard wrote: > > +extern int sysctl_cow_pte_pid; > > So are setting a global value, to a single pid?? Only one pid at a time > can be set up? > > I think that tells you already that there is a huge API problem here. > > As the other thread with Nadav said, this is not a sysctl. It wants to > be a prctl(), at least the way things look so far. I will change it to use the prctl(). Probably it will be under PR_SET_MM or create a new option. > > +static void set_cow_pte_task(void) > > +{ > > + struct pid *pid; > > + struct task_struct *task; > > + > > + pid = find_get_pid(sysctl_cow_pte_pid); > > This seems to be missing a corresponding call to put_pid(). Thanks. > thanks, > > -- > John Hubbard > NVIDIA > Best regards, Chih-En Lin