From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752368AbeADHow (ORCPT + 1 other); Thu, 4 Jan 2018 02:44:52 -0500 Received: from out4434.biz.mail.alibaba.com ([47.88.44.34]:19207 "EHLO out4434.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752332AbeADHou (ORCPT ); Thu, 4 Jan 2018 02:44:50 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R271e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03273;MF=jinli.zjl@alibaba-inc.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.A3GnKCj_1515051860; Subject: Re: [PATCH] mm/fadvise: discard partial pages iff endbyte is also eof From: "=?UTF-8?B?5aS35YiZKENhc3Bhcik=?=" To: Mel Gorman Cc: "Andrew Morton" , , , , "=?UTF-8?B?5p2o5YuHKOaZuuW9uyk=?=" , "=?UTF-8?B?5Y2B5YiA?=" References: <1514002568-120457-1-git-send-email-shidao.ytt@alibaba-inc.com> <8DAEE48B-AD5D-4702-AB4B-7102DD837071@alibaba-inc.com> <20180103104800.xgqe32hv63xsmsjh@techsingularity.net> <7dd95219-f0be-b30a-0a43-2aadcc61899c@alibaba-inc.com> Message-ID: <63eeeda3-6e94-69e5-9cfc-75d34a4c4e4a@alibaba-inc.com> Date: Thu, 04 Jan 2018 15:44:20 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <7dd95219-f0be-b30a-0a43-2aadcc61899c@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 2018/1/4 14:13, 夷则(Caspar) wrote: > > This patch is trying to help to solve a real issue. Sometimes we need to > evict the whole file from page cache because we are sure it will not be > used in the near future. We try to use posix_fadvise() to finish our > work but we often see a "small tail" at the end of some files could not > be evicted, after digging a little bit, we find those file sizes are not > page-aligned and the "tail" turns out to be partial pages. > > We fail to find a standard from posix_fadvise() manual page to subscribe > the function behaviors if the `offset' and `len' params are not Oops, I find a 'standard' documented in latest man-pages.git[1], blame my centos7, it runs with an old man-pages.rpm :-( Thanks, Caspar [1] https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?h=ceb1c326b9f3e863dfd9bf33bc7118bb1fa29bfc > page-aligned, then we go to kernel tree and see this: > >         /* >          * First and last FULL page! Partial pages are deliberately >          * preserved on the expectation that it is better to preserve >          * needed memory than to discard unneeded memory. >          */