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 832F4C433F5 for ; Thu, 19 May 2022 07:40:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD4CC6B0075; Thu, 19 May 2022 03:39:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C85146B0078; Thu, 19 May 2022 03:39:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9B326B007B; Thu, 19 May 2022 03:39:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id ACA6F6B0075 for ; Thu, 19 May 2022 03:39:59 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 79A30328E2 for ; Thu, 19 May 2022 07:39:59 +0000 (UTC) X-FDA: 79481693718.28.9D44D9E Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf26.hostedemail.com (Postfix) with ESMTP id 8690D1400D4 for ; Thu, 19 May 2022 07:39:55 +0000 (UTC) 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-Stat-Signature: zp77a1sijjee8wgfowk3pbgg9wysj8dm Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=oGgZM6lB; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 8690D1400D4 X-HE-Tag: 1652945995-677451 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 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