Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757166Ab2BMQWs (ORCPT ); Mon, 13 Feb 2012 11:22:48 -0500 Received: from mail-yx0-f174.google.com ([209.85.213.174]:65432 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755067Ab2BMQWq (ORCPT ); Mon, 13 Feb 2012 11:22:46 -0500 MIME-Version: 1.0 In-Reply-To: <1329006098-5454-4-git-send-email-andrea@betterlinux.com> References: <1329006098-5454-1-git-send-email-andrea@betterlinux.com> <1329006098-5454-4-git-send-email-andrea@betterlinux.com> From: KOSAKI Motohiro Date: Mon, 13 Feb 2012 11:22:26 -0500 X-Google-Sender-Auth: Swh99qbykZLzXYvDf4qT1DnySAQ Message-ID: Subject: Re: [PATCH v5 3/3] fadvise: implement POSIX_FADV_NOREUSE To: Andrea Righi Cc: Andrew Morton , Minchan Kim , Peter Zijlstra , Johannes Weiner , KAMEZAWA Hiroyuki , Rik van Riel , Hugh Dickins , Alexander Viro , Shaohua Li , =?ISO-8859-1?Q?P=E1draig_Brady?= , John Stultz , Jerry James , Julius Plenz , linux-mm , linux-fsdevel@vger.kernel.org, LKML Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id q1DGMqRY002888 Content-Length: 1199 Lines: 23 > @@ -1181,8 +1258,22 @@ page_ok: > ? ? ? ? ? ? ? ? * When a sequential read accesses a page several times, > ? ? ? ? ? ? ? ? * only mark it as accessed the first time. > ? ? ? ? ? ? ? ? */ > - ? ? ? ? ? ? ? if (prev_index != index || offset != prev_offset) > - ? ? ? ? ? ? ? ? ? ? ? mark_page_accessed(page); > + ? ? ? ? ? ? ? if (prev_index != index || offset != prev_offset) { > + ? ? ? ? ? ? ? ? ? ? ? int mode; > + > + ? ? ? ? ? ? ? ? ? ? ? mode = filemap_get_cache(mapping, index); > + ? ? ? ? ? ? ? ? ? ? ? switch (mode) { > + ? ? ? ? ? ? ? ? ? ? ? case FILEMAP_CACHE_NORMAL: > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_page_accessed(page); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break; > + ? ? ? ? ? ? ? ? ? ? ? case FILEMAP_CACHE_ONCE: > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_page_usedonce(page); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break; > + ? ? ? ? ? ? ? ? ? ? ? default: > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? WARN_ON_ONCE(1); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break; Here is generic_file_read, right? Why don't you care write and page fault? ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?