Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp513581ybi; Fri, 24 May 2019 07:19:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7DRqdyZh8YbLg7+fVkyrBhKsBfeTaaE+rxHJUMahtl53oVZv8XJN9S9V+JOaeWqkf6ePK X-Received: by 2002:a62:2fc6:: with SMTP id v189mr75513094pfv.136.1558707548345; Fri, 24 May 2019 07:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558707548; cv=none; d=google.com; s=arc-20160816; b=aP6spxkank2oyu8DsoapDk3tKOLH4YTVicA7HpIuIafAuINXfvtZkPSufWAeJ8BiA8 RQcn4rZPEoeUx1xOCXMs6P/I8TnCooyDWJ1gUUkwer79S/1g8jc1gVejb++n/eAutb40 WOSzEBcrxFJBAsREvuuxjN/qpwbqUuldKfzu20IpgUV4bHDHYWn77vzjhAhU+VAZuAyf XKZxFVsIJgN78fSL/BlemlwE5ZhBtr0DCKQOOgH1dv9byIpkNgL7mgK/A+SkwOEeoDEm hw/8puF/kH63MwJBKonuVzL9JjNh5tn4xs37BvXTkce4IcubdZ4yFh+NUum3vlBTA0Xh XO5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vdyE1IbAdrPQM5ovOiRyFmLzasbQZYXuZYfheCMJqbw=; b=fc/YyNbE5q7jrIZcE6PdmR03KnGzgT4Di+aPAStU87dVEqpxWWxExoLaDVB2C4XARp RYFvoVHtyNVSzPHoA7RUTPPs5ap7R+tVDcJ07uxkn8RY3kYvi6GpzzpPqUL7pcHJeg0D Zv5aKq2X6/XqEIqLurhbyk1/XgfOtjvfhvTWWTqFcqf8zPlNwEk2qf2sxYw7PIOU+wU6 1TPssU/g6ajIcMFYVuvx+0OwBd0ylyC1euunIZWPbVurnP2VlFDmEJC1ej5fpYk1J6Mo ON/cG70jJNZHVEjzi8YYjR+bA+onJdYl9az8YZN1b/Gdb/AZRnJGRC8zGdfdsRhgT7ZP sbZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KJwYtNp1; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si4054694pjf.77.2019.05.24.07.18.50; Fri, 24 May 2019 07:19:08 -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=pass header.i=@gmail.com header.s=20161025 header.b=KJwYtNp1; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404059AbfEXOP4 (ORCPT + 99 others); Fri, 24 May 2019 10:15:56 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:38191 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403934AbfEXOPz (ORCPT ); Fri, 24 May 2019 10:15:55 -0400 Received: by mail-io1-f67.google.com with SMTP id x24so7870354ion.5; Fri, 24 May 2019 07:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vdyE1IbAdrPQM5ovOiRyFmLzasbQZYXuZYfheCMJqbw=; b=KJwYtNp1/BjIMkX4VKbEUgHdFouFvetXHPDJveI0b3Ib6xzsuqTxF7PIjCxLpW7Eap WJSX4UCRckSN6zNL9IiwbPkAxAj2w61Cr43tKha13ZNT0+RlQ0FwaQ9+BZABAibmQfi8 Dw9uEq4qglSsKbNnuhTEqJsLqSkk7cH4r1Keb9LBHTQMb8d/AfpW/HqPukaEuCVscPqJ ro9FPkBbsEubuT6G+y2WWlnvvupvpzXnrxmfnJQ4e+HzywUy2V45iy48CI/2DeT2KY+8 3avOHiHazJ4D37WP/HvjykI8fp+vdUi1pUI80k87kUdA7PN9fIcWPPKUYN/oyP+ZpUtW p3iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vdyE1IbAdrPQM5ovOiRyFmLzasbQZYXuZYfheCMJqbw=; b=Yit8i1kaPeY7ww2y/l0fnoo2KI6QxAq3NJmXM12CnoMrnD7d6CcvwqgBxgovaOSJPC uGErl70tcDZaoLZv60KthVqnfwZ5GoJC4w7FtJvEcM0WpRrU4vYqVD4yHos4R+1Z9FMz sID/rW9UWFG7z5XI11rG1TDUhWGIWQ7SNQDZ/FnHebmHRra6emLTMbSi9EFWTPsQi3gK BLcjzNq2e3NZJJOUpupTj38NAhLVsQEi7XEEqQxRqGIzzOxKUggTSl/BRzInPgCNJd3L cNQTBakqB8zoetXmYHuezCNbdl7RRe25uX09/66HfFqoi2NZDTgtYP4piXSUO6RvOwCH batw== X-Gm-Message-State: APjAAAUyLbmP6khe+a8jaKrCEdec4pTOf9O3JYQJ4bTe53xw9zN5++z5 HMwD3q1Jo94OCYPowA8FTEy0goGUcCwf3lX++aE= X-Received: by 2002:a5d:870e:: with SMTP id u14mr5195204iom.44.1558707355030; Fri, 24 May 2019 07:15:55 -0700 (PDT) MIME-Version: 1.0 References: <1558685161-860-1-git-send-email-stummala@codeaurora.org> In-Reply-To: <1558685161-860-1-git-send-email-stummala@codeaurora.org> From: Yafang Shao Date: Fri, 24 May 2019 22:15:18 +0800 Message-ID: Subject: Re: [PATCH] mm/vmscan.c: drop all inode/dentry cache from LRU To: Sahitya Tummala Cc: Andrew Morton , Kirill Tkhai , Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Mel Gorman , Linux MM , "Theodore Y. Ts'o" , Jaegeuk Kim , Eric Biggers , linux-fscrypt@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 4:06 PM Sahitya Tummala wrote: > > This is important for the scenario where FBE (file based encryption) > is enabled. With FBE, the encryption context needed to en/decrypt a file > will be stored in inode and any inode that is left in the cache after > drop_caches is done will be a problem. For ex, in Android, drop_caches > will be used when switching work profiles. > > Signed-off-by: Sahitya Tummala > --- > mm/vmscan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index d96c547..b48926f 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -730,7 +730,7 @@ void drop_slab_node(int nid) > do { > freed += shrink_slab(GFP_KERNEL, nid, memcg, 0); > } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL); > - } while (freed > 10); > + } while (freed != 0); > } Perhaps that is not enough, because the shrink may stop when scan count is less than SHRINK_BATCH. Pls. see do_shrink_slab. What about set shrinker->batch to 1 in this case ? Thanks Yafang