Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1524487iob; Thu, 19 May 2022 08:22:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA8xm+3dhA8RwfEsVWg9OA6MbpL3FxbkYNC8orwdaDAwFRIzpKM0zcwrE/4HaSPlb/V6FE X-Received: by 2002:a17:907:9711:b0:6f4:6989:6afb with SMTP id jg17-20020a170907971100b006f469896afbmr5037013ejc.618.1652973766162; Thu, 19 May 2022 08:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652973766; cv=none; d=google.com; s=arc-20160816; b=jZ5fg5Bto9lhidAwuB8CSePjZ5WIcVKDiaeSi0GLqQNmFTXe1Rm1QTlijLZtH7MOkC 0JjfRXCr50PjxsrzGyBbFwatMf4zLRDnMdQJtgDPookXXkQNAPa38KarkjKYxus1LmK6 zarpOnMNgbq1w5wYtqibH1kzdLAxZoR1I3qdGSgvlOQNkzZVIZskZD8pLcnfKHvUk1gA aPmOvI28Vn8R2VjmqGdvwNED602G/CDx1XGG8j44PdW5BDQgI3aP+lcYZzEqJ6a8LUR3 CirWEYTPc5EE4UUxSQfA2zpwpL8dUzsoj+mg1nNgZNdYQgCiuPgiKFp19s1thG5D0HUR jUyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OvcEjdguxGnwRWakoTdTRdMP5F/4qelWY0PnvK8A6+M=; b=aYgh3zVH3hy+gFDghKbJwmyf7cyMuPq2KQ874OfZe5yOKDssI19CMHL7knJ/xv0trP mg5Iz6ewVAXEUaYjmZIhIoUx+O5cWb1XsIk2pVQEef4IUisD2tHVOL4l7cM0TW4/bqHq 55iwHdhlfxm5Rhc/Tvww5glXsEphh+HZjhQ3HcZEDOd8zvGHlnXNfgx49ETwNWgzhztR jj7l9V4J64/YeZRAsR4lJS4hsTvUI6xuIGGVqT4wENjbffpBn7FrHXWZFRzzuA8BDKBX UQv7W8z8URzJ8RYcvqWnEpgpDO6bhaQza8eWw0rnEUQiCBA7Dz04Vu2VGVsTa7zmjsHs TdmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=oGgZM6lB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd10-20020a170907628a00b006fe876d7bfasi6066917ejc.837.2022.05.19.08.22.20; Thu, 19 May 2022 08:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=oGgZM6lB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234866AbiESHkB (ORCPT + 99 others); Thu, 19 May 2022 03:40:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234381AbiESHj7 (ORCPT ); Thu, 19 May 2022 03:39:59 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3076EA7E33 for ; Thu, 19 May 2022 00:39:59 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E21961FA13; Thu, 19 May 2022 07:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652945997; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OvcEjdguxGnwRWakoTdTRdMP5F/4qelWY0PnvK8A6+M=; b=oGgZM6lB6cAcir50cgUhVLfnt5gGSAUacckFWk5mt34xxqahj6uTk3MliVo5a7Fw3pYwwz L5c9YoV+qWYwqW6Mad86XmXhg/5fJuZVYi20dyAFriMCnpt6Uf7ixCApNFUAQMDGDJUTAN u5vzm/tGAqfM+PXdOHBayGlGY5IwQWw= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id AFE5E2C141; Thu, 19 May 2022 07:39:57 +0000 (UTC) Date: Thu, 19 May 2022 09:39:57 +0200 From: Michal Hocko To: CGEL 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 Message-ID: References: <20220517092701.1662641-1-xu.xin16@zte.com.cn> <6284a2ef.1c69fb81.e53cd.32b2@mx.google.com> <6285e519.1c69fb81.4f3fe.8057@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6285e519.1c69fb81.4f3fe.8057@mx.google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 19-05-22 06:35:03, CGEL wrote: > 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". This means that /proc//smaps doesn't show the real state, right? -- Michal Hocko SUSE Labs