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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D20C2BB1D for ; Tue, 17 Mar 2020 19:29:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D6F9520752 for ; Tue, 17 Mar 2020 19:28:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6F9520752 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 480246B0005; Tue, 17 Mar 2020 15:28:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40B4B6B0006; Tue, 17 Mar 2020 15:28:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D2356B0007; Tue, 17 Mar 2020 15:28:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 127B16B0005 for ; Tue, 17 Mar 2020 15:28:59 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A7D2A4826 for ; Tue, 17 Mar 2020 19:28:58 +0000 (UTC) X-FDA: 76605841956.28.jar21_312577b1cb458 X-HE-Tag: jar21_312577b1cb458 X-Filterd-Recvd-Size: 2712 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 19:28:57 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0TsuFGLH_1584473331; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TsuFGLH_1584473331) by smtp.aliyun-inc.com(127.0.0.1); Wed, 18 Mar 2020 03:28:53 +0800 Subject: Re: [v3 PATCH 1/2] mm: swap: make page_evictable() inline To: Matthew Wilcox Cc: shakeelb@google.com, vbabka@suse.cz, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1584466971-110029-1-git-send-email-yang.shi@linux.alibaba.com> <20200317190411.GD22433@bombadil.infradead.org> From: Yang Shi Message-ID: <03aa047b-4e52-d5fb-c212-b341df4ea07f@linux.alibaba.com> Date: Tue, 17 Mar 2020 12:28:49 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200317190411.GD22433@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 3/17/20 12:04 PM, Matthew Wilcox wrote: > On Wed, Mar 18, 2020 at 01:42:50AM +0800, Yang Shi wrote: >> v3: * Fixed the build error reported by lkp. > I'm not terribly enthusiastic about including pagemap.h from swap.h. > It's a discussion that reasonable people can disagree about, so let's > set it up: > > This patch adds inline bool page_evictable(struct page *page) to swap.h. > page_evictable() uses mapping_evictable() which is in pagemap.h. > mapping_evictable() uses AS_UNEVICTABLE which is also in pagemap.h. > > We could move mapping_evictable() and friends to fs.h (already included > by swap.h). But how about just moving page_evictable() to pagemap.h? > pagemap.h is already included by mm/mlock.c, mm/swap.c and mm/vmscan.c, > which are the only three current callers of page_evictable(). > > In fact, since it's only called by those three files, perhaps it should > be in mm/internal.h? I don't see it becoming a terribly popular function > to call outside of the core mm code. > > I think I have a mild preference for it being in pagemap.h, since I don't > have a hard time convincing myself that it's part of the page cache API, > but I definitely prefer internal.h over swap.h. Thanks for the suggestion. Will move it to pagemap.h