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 F1BA1C433F5 for ; Thu, 19 May 2022 06:35:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 705E26B0072; Thu, 19 May 2022 02:35:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B5956B0073; Thu, 19 May 2022 02:35:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57CA86B0074; Thu, 19 May 2022 02:35:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 489976B0072 for ; Thu, 19 May 2022 02:35:07 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 16C9331CA1 for ; Thu, 19 May 2022 06:35:07 +0000 (UTC) X-FDA: 79481530254.05.20821F7 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf03.hostedemail.com (Postfix) with ESMTP id 247D0200BE for ; Thu, 19 May 2022 06:34:56 +0000 (UTC) Received: by mail-pl1-f181.google.com with SMTP id n8so3955217plh.1 for ; Wed, 18 May 2022 23:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:in-reply-to; bh=0QO+yAJAb2csGUEWJV5Lz6AxrUMHlZtpKHVoWb0K4lk=; b=EYsxmJTAQ2kk+Qz75hJzyVSjLw4lrKLxgB8AAHNkivdTr35N+89e15LGk9fl81QMLi 2n2jo/DPwomTli0zYtdSiluHSsg6CCpDxpO8cIpV+Abf8B9mpNyroaKMN80PSdICdhz4 IkNuJtDBekdWXN/y9XVYwfGEQkLwjO5IehGV4RXOD8x70PZsafVRIMMhPgcDBuoNHNG1 A0PlLebuEq2cDywc2Z2UuBN5NsYapPoTTGCcUXPc3/Di/43kNeVPWBRozBu0Zi4c7bwX EpW3qHfDFNAdn7rrzILByHZPqgwAmPnuDQ8/jSkbuPnDEAyw8jGcuvBCqE9C60RTDybe GzdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:in-reply-to; bh=0QO+yAJAb2csGUEWJV5Lz6AxrUMHlZtpKHVoWb0K4lk=; b=VDIQYfyu2Wou3+DfVqxsP+vm92mFzZbXqY3yVS8HnNljbAbs+jQ2xJkBQLhBOk3Bht xqTwKDLLC3LnP/QzPFdWUzb4mjL8aA1A7hOGZZzkVJbu7WtNnKWa619PNuRdmToozi2q /01boafyZrPiD0DIFOO78EQ1pC0zeEeNqbLxynMTtxDx1K9EW7NWSMiAuGbX30Eywqyj VXQlVm48YxAQLModikVErNQ9yZUP3rOD3x5Jvk1wZcupgjMpTq5pQzzSdXNh5xKURCeo szAogOJpy5KThd26d+CemXS1nkjYJu1DDlPSSIPtErthrgN/Dw90IV+FkaAZwdlXSjP6 JM8w== X-Gm-Message-State: AOAM531bsjhgbJaql9hdJcX5QO1VBkqICxrGC5XuJjZe84670G/k3d3A TIJBtK8Bp6twT4eRj33+4PA= X-Google-Smtp-Source: ABdhPJy2ZA+96kFf9ij7hkkB623ie0jxPWismA0v9a1zRZtwMcP8ghKe+mJ01ECDLOISJgWona5rPQ== X-Received: by 2002:a17:90a:760d:b0:1df:6423:d0b9 with SMTP id s13-20020a17090a760d00b001df6423d0b9mr4151740pjk.33.1652942105672; Wed, 18 May 2022 23:35:05 -0700 (PDT) Received: from localhost ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id y16-20020aa78550000000b0050dc762819csm3064723pfn.118.2022.05.18.23.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 23:35:05 -0700 (PDT) Message-ID: <6285e519.1c69fb81.4f3fe.8057@mx.google.com> X-Google-Original-Message-ID: <20220519063503.GA1736086@cgel.zte@gmail.com> Date: Thu, 19 May 2022 06:35:03 +0000 From: CGEL To: Michal Hocko Cc: Balbir Singh , akpm@linux-foundation.org, ammarfaizi2@gnuweeb.org, oleksandr@natalenko.name, willy@infradead.org, linux-mm@kvack.org, corbet@lwn.net, linux-kernel@vger.kernel.org, xu xin , Yang Yang , Ran Xiaokai , wangyong , Yunkai Zhang , Jiang Xuexin Subject: Re: [PATCH] mm/ksm: introduce ksm_enabled for each processg References: <20220517092701.1662641-1-xu.xin16@zte.com.cn> <6284a2ef.1c69fb81.e53cd.32b2@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 247D0200BE X-Stat-Signature: 6srmpao8dr638yski4rhcq7hymreix9b Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EYsxmJTA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of cgel.zte@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=cgel.zte@gmail.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1652942096-208003 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 Wed, May 18, 2022 at 02:14:28PM +0200, Michal Hocko wrote: > On Wed 18-05-22 07:40:30, CGEL wrote: > [...] > > 2. process_madvise is still a kind of madvise. processs_madvise from > > another process overrides the intention of origin app code ifself that > > also calls madvise, which is unrecoverable. For example, if a process "A" > > which madvises just one part of VMAs (not all) as MERGEABLE run on the OS > > already, meanwhile, if another process which doesn't know the information > > of "A" 's MERGEABLE areas, then call process_madvise to advise all VMAs of > > "A" as MERGEABLE, the original MERGEABLE information of "A" calling madivse > > is erasured permanently. > > I do not really follow. How is this any different from an external > process modifying the process wide policy via the proc or any other > interface? In this patch, you can see that we didn't modify the flag of any VMA of the target process, which is different from process_madvise. So it is easy to keep the original MERGEABLE information of the target process when we turn back to the default state from the state "always". > -- > Michal Hocko > SUSE Labs