Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1676677ybi; Thu, 20 Jun 2019 01:46:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8KSU67FPnzuG9bCYIl9IJWI8YrwvpWhLlMnoHOEFbMeUzfQYqnwgMciPayUpFZlrPrWrE X-Received: by 2002:a17:902:b186:: with SMTP id s6mr13154963plr.343.1561020373529; Thu, 20 Jun 2019 01:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561020373; cv=none; d=google.com; s=arc-20160816; b=NCQ72aiyD6smgjaW4rgHOd4b6gK/tI6UI2golmRCPDfNZz8ZW1YBN1fgl6G4GuCDlf l0juWGaWqsQwPhPqBqpDLsYrc9dsmKeLN0LjtyN0OzA8+c2qVGQuOeLX1R//rNSpjiuM K5xuFCKos6mdU3P7sOj/+9UzRXGNdVR1s51XJCdZyHNkz0QCrR2DhWpbzzCK8u/zTu/R I0wbTZEqPGv4vV2UpWv7LhQwq7XYhB8/t100JnYVSoAT2Mo0jZLBJp56CJt5aXZGKKGS MyMLvNqqCqr+fA16YmoN83+ugc3rYok/pZGd/PNLNRbLSe9QFTTxVbhgsDZBuvlVKS2l TjIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sYUDpApbnrIBn4i7klGE9UQ92KtpIubNAiUNXQIv47k=; b=t4sasBDlGsaeqllCKt9YLk63voLZ5+IA40l1csUxqYV5yUlx1HEHGNaKB7e/QMitYO tZyKijlmAgfQ21fqgpaaSfxBQjlc4RR+sIRcVsgJHcmHbH+Ezk+DStXvumEBDcvu7hd4 pYl8uvpO3iLrNfFHk2mnlaxmVNxueYFsr54BQVAEfuy/FHOi/E3w4lXX/w0+K44VI+Vp y5FrAXBdpZr2mvP8Tvh95oeI07z8P7x5jipoLBQ89+oSXUv9znJ1pTHWDNIxbMM0Pupp xLzYQ6DmZvu3RElMBMnr4nrKXrQQMu1B+MINs6IHdpie8x5B6xumO06/+sLJGEHn3lhq lFJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aEzfvWfh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si3922142pja.67.2019.06.20.01.45.57; Thu, 20 Jun 2019 01:46:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aEzfvWfh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730583AbfFTIoP (ORCPT + 99 others); Thu, 20 Jun 2019 04:44:15 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41456 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfFTIoP (ORCPT ); Thu, 20 Jun 2019 04:44:15 -0400 Received: by mail-pl1-f196.google.com with SMTP id m7so1096931pls.8; Thu, 20 Jun 2019 01:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sYUDpApbnrIBn4i7klGE9UQ92KtpIubNAiUNXQIv47k=; b=aEzfvWfhJfjqwaVDjQ+y2Jj8uQ5QLxM1Z9rSTwdKEVkhpfKq1+Vqx4cQoEo3LUbewb nU43G4E5gYmlEqHnYPXnoi+dPlxxjyj2hEDeLmCouA0sk/KCNJqQM5lOtVQx7zd4IeOc Nu+R1IfH6LIZkVvQqJ0U2YjQ2u4vWRTNlgJkN4NcOLwYjLzEYcopTqj/2uLvHTnvSQPU G6VczY8GZn0HQXUzj2HmCQ64NCkoar+aFuvgFDt+OhG2jMZha7ZvtmNq0lzwD3a6508x bjre/yWIfx9smdOvOz6K9HtuVd9grJ7MlUsBVt5ku7kkUWkZ7zoHCriBmFVGGGAb2L31 6iuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=sYUDpApbnrIBn4i7klGE9UQ92KtpIubNAiUNXQIv47k=; b=cUQiLb+AUMUFfjGRgpb7Smdy8T8FA5/9wDfLlE7Ny+xtnhmsu2Q6n9by2CZxzp5W3/ pCj6+D25ELP7SpsxR0eyqDPtmUmpZbJZMZuqyMrC18xgnwMbeIHOrCPdXPzN/5pPBjbB uwgg6pGS0+8TGvh4hHzh0vWEKyxSQG47X73YiPzYGUuz2wCawj4PbT2pllVsBy6+dOmA 7I6Hqh6PyRmiXEz9gfm/3QQKj0nIhiJ1g7DZqBTkV6Zvq75bPNLgEgT2fUwX/whcmbVg 4LXmbQLmaiBFgBTxkk8nOhsJZznLl6yX+vlhhpaaVzuY4qnZfPpZLkgDDsqPdnMHxCHp k1Zw== X-Gm-Message-State: APjAAAVYlc0Az1nhFTbBDmgkx3hEyM/JgNnKFPmKNLm/PHyHgSSZA9GG Z7b9JoUH2Ul7rtKRlayksUo= X-Received: by 2002:a17:902:290b:: with SMTP id g11mr121725061plb.26.1561020254488; Thu, 20 Jun 2019 01:44:14 -0700 (PDT) Received: from google.com ([2401:fa00:d:0:98f1:8b3d:1f37:3e8]) by smtp.gmail.com with ESMTPSA id q144sm28994756pfc.103.2019.06.20.01.44.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 01:44:12 -0700 (PDT) Date: Thu, 20 Jun 2019 17:44:06 +0900 From: Minchan Kim To: Michal Hocko Cc: Andrew Morton , linux-mm , LKML , linux-api@vger.kernel.org, Johannes Weiner , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Daniel Colascione , Shakeel Butt , Sonny Rao , Brian Geffon , jannh@google.com, oleg@redhat.com, christian@brauner.io, oleksandr@redhat.com, hdanton@sina.com, lizeb@google.com Subject: Re: [PATCH v2 1/5] mm: introduce MADV_COLD Message-ID: <20190620084406.GE105727@google.com> References: <20190610111252.239156-1-minchan@kernel.org> <20190610111252.239156-2-minchan@kernel.org> <20190619125611.GO2968@dhcp22.suse.cz> <20190620000650.GB52978@google.com> <20190620070854.GC12083@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190620070854.GC12083@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 20, 2019 at 09:08:54AM +0200, Michal Hocko wrote: > On Thu 20-06-19 09:06:51, Minchan Kim wrote: > > On Wed, Jun 19, 2019 at 02:56:12PM +0200, Michal Hocko wrote: > [...] > > > Why cannot we reuse a large part of that code and differ essentially on > > > the reclaim target check and action? Have you considered to consolidate > > > the code to share as much as possible? Maybe that is easier said than > > > done because the devil is always in details... > > > > Yub, it was not pretty when I tried. Please see last patch in this > > patchset. > > That is bad because this code is quite subtle - especially the THP part > of it. I will be staring at the code some more. Maybe some > simplification pops out. Yeah, I couldn't come up with better idea. Actually, I wanted to be left. More suggestion to make simple/readable would be great.