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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73630CCA47B for ; Thu, 2 Jun 2022 18:30:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E434A6B0071; Thu, 2 Jun 2022 14:30:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DF12F6B0073; Thu, 2 Jun 2022 14:30:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDB9E6B0074; Thu, 2 Jun 2022 14:30:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C22DA6B0071 for ; Thu, 2 Jun 2022 14:30:56 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9606514C5 for ; Thu, 2 Jun 2022 18:30:56 +0000 (UTC) X-FDA: 79534137312.12.79936A1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id D2B0B180067 for ; Thu, 2 Jun 2022 18:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=szmXLXEXgQOPuLalg0aYhE0tI19hGUcMHnWH4EuhWQQ=; b=XK+ihUFSjVewy3Wqvp7T2ae/pU zNMW5BLtsVutVxZTw7Qws/rOQgCUXjg9HPZizeEmSi27XFzVw2w6iqHZ7PS+1Nq9FkWwwP4HJNAZA QhWsq3tDhP1FpiQzhby90/OC2WRgWLXFKXbyy9onFdbfadXe5orf7Vuy0nDwli9YqWwlyxLug0/NQ MkomceVyqgn1OoLysggFDxFMrIr/4DNTUa2SqzanbBgO+4jzF4kuVbImokwMWZh9NKr6bBE3O1fxP AQ+o3KoXGiHgM23P1C1vUwI0rEkBkfl20eBGD130fxM43Kj0z1GIC5XY5x3BwyeJbOEIsWbVy0tMl tsX7cREg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwpap-007LM4-2H; Thu, 02 Jun 2022 18:30:47 +0000 Date: Thu, 2 Jun 2022 19:30:47 +0100 From: Matthew Wilcox To: Yu Kuai Cc: akpm@linux-foundation.org, kent.overstreet@gmail.com, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH -next] mm/filemap: fix that first page is not mark accessed in filemap_read() Message-ID: References: <20220602082129.2805890-1-yukuai3@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220602082129.2805890-1-yukuai3@huawei.com> X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D2B0B180067 X-Stat-Signature: r8uggsrk8pbhr7hr1zwti1zi5zsxidbq Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=XK+ihUFS; dmarc=none; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1654194651-509810 X-Bogosity: Ham, tests=bogofilter, spamicity=0.005389, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jun 02, 2022 at 04:21:29PM +0800, Yu Kuai wrote: > In filemap_read(), 'ra->prev_pos' is set to 'iocb->ki_pos + copied', > while it should be 'iocb->ki_ops'. Can you walk me through your reasoning which leads you to believe that it should be ki_pos instead of ki_pos + copied? As I understand it, prev_pos is the end of the previous read, not the beginning of the previous read. For consequence, > folio_mark_accessed() will not be called for 'fbatch.folios[0]' since > 'iocb->ki_pos' is always equal to 'ra->prev_pos'. I don't follow this, but maybe I'm just being slow.