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 94A87C54798 for ; Tue, 27 Feb 2024 17:02:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E53D94002C; Tue, 27 Feb 2024 12:02:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1952694000E; Tue, 27 Feb 2024 12:02:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05D4294002C; Tue, 27 Feb 2024 12:02:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E92FB94000E for ; Tue, 27 Feb 2024 12:02:58 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 775D9120D2F for ; Tue, 27 Feb 2024 17:02:58 +0000 (UTC) X-FDA: 81838203636.09.82EE70F Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) by imf26.hostedemail.com (Postfix) with ESMTP id 74DDA140039 for ; Tue, 27 Feb 2024 17:02:56 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Zwzw8Db3; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf26.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.187 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709053376; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L7UKNUBGlTpDM+CMJiwE59d0Y/y96axVL+XtjpcRUAA=; b=xtJfGJFJxbFDJGRhAS6+wqjQkR+xhnBfDOpDAVmYQvebf4/4Vr/mBo3a7/rpUrsesv5l69 r/d+5xeMsak3NJF8P2kFHIqjofcMELFQvXMgqJSvv68tTQ1vdYeYxh79VnarrwefOToaGg bHihvYAZwcwdfQUYzOedlrTD6T3RUBg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Zwzw8Db3; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf26.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.187 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709053376; a=rsa-sha256; cv=none; b=GxVxq5/UTjvG/bBxFfilidf00h7LMinyAxEGEMgCXMDJ38xNd/JOBHKxFl8VS2u8Ro6bcc FmbfU2uXpXWIJTm8p+ToBykR7fNE6UP4Rc407NdLSHyBbPlHVU2CR84/cjPLcII9SMiDng 7fIdGMuj0I/6JFVNvqQBVj0UQi1hYzg= Date: Tue, 27 Feb 2024 12:02:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1709053374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L7UKNUBGlTpDM+CMJiwE59d0Y/y96axVL+XtjpcRUAA=; b=Zwzw8Db3LDsRNenY3gGa6Tbi9kd/j+4+EG0yzxqltzcHBRhreGIzqWUegudphiZIy7OVqz eO//SmJ5XmyEQXUl1CgTYL41h6t2FLjxJGpkdi9zUiUudSS6P9f4h3G9UAmDgDo9owgxi7 mkil4OFoWnUlRblZaE0G4d99LhmFBfA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: "Pankaj Raghav (Samsung)" Cc: Matthew Wilcox , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, ziy@nvidia.com, hare@suse.de, djwong@kernel.org, gost.dev@samsung.com, linux-mm@kvack.org, Pankaj Raghav Subject: Re: [PATCH 03/13] filemap: align the index to mapping_min_order in the page cache Message-ID: References: <20240226094936.2677493-1-kernel@pankajraghav.com> <20240226094936.2677493-4-kernel@pankajraghav.com> <37kubwweih4zwvxzvjbhnhxunrafawdqaqggzcw6xayd6vtrfl@dllnk6n53akf> <4zpsfvy3e4hkc4avvjjr34rgo7ggpd6hpflptmiauvxwm3dpvk@5wulihwpwbyp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4zpsfvy3e4hkc4avvjjr34rgo7ggpd6hpflptmiauvxwm3dpvk@5wulihwpwbyp> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 74DDA140039 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: hd99d7776ais6x7zjo63qbpa965w6sgz X-HE-Tag: 1709053376-30700 X-HE-Meta: U2FsdGVkX18n1TDEfw+vFfc+Rpd9UsL69eXR/+WnufPePra08cFvBtQSPZSD2SM9guaiUSmLFOspDkk3pDpOPiNUYgjDpokMmUwafv0QWxnCk6K8dIHVs0omRvJjvyamnVX1SaSWURykcuk7X3vwG30wBJYZBGLrPxHG71cprOcr+UsVAf8OVPXRimKy2+gDy5DePDJ+YdDGc/HM1xjFeOfFtFcI24tu7/Gi+XzyOycskn8JRI4k3ERpCavqqWEJm8GceuCSINl+LkhAxqcUtvIn57w1PStH35L/1/Dmi5As8mfecZke3NPbpkfjCk2Qd5QrDIJCYFCu9gjzHnpNvOhpyl9KKlUPZchHbga59Dt5wi+ek2ycn3xl+u3c1Gpsatz58DUsMy614lyAwFKZ9vaS+S8NqeTQl5IJDBRm4JZCKzYO8LdcG9EQeXbKX7hytyfoKvYU+gOMcoX16V10hu3rndrDQYxrUtCx8LbMwibZW9NLNOCrqZOLh06VgD0b9/mKic3TvD98dkDn078wKpaTjCcEPo2QUGa7dvnBcTPMU0DNsbX+pHO1bRYKdaXqDdu+7ewKZcH1EPw09dM+tycQ5FzVjl1oe20/bCU3ypN4rVXrMluAcg/0B2GxURerwURCAIxb3m4PZou6W9fzzPDJvOphQYWqN0B83zVTfMxWxWk/AJhvODnxppYIa20+1ua/ylD7xy7BOa5E0rqg7T10AHHs+vIpFqHH4HnMTJJD8b5r6GZxQIqE4xCaICLIVjsbr8DiPcKs6IEHC+cCHoh4xBoeqD6HddhABo8gLwG+ti5dlzuoPe4vJXuKgI37upXln9VToWWODFGHqDNP836RYfNGG6GfP/ody5/gaq+Jk27tuhvXC+qfjQDMq0w3g2+EJqzplnj93S6qBfIQjBAmZqPiNIvMqS5Qccv+E2JysDuxNub2rUaa7sWouLUOgIGtS6+j5m4N8jYGlrW Grj0bSFS Qo/WQ8s+QLwLVdNRy2v6yhZmKYh7xSQZX3a5VRgUpR79CECzpiMgxPstXd4i8NhYrfSyvCXQaal2qD14pyt9GcmffroTK+OeEuGjH/krfqFGX2tBky5K655wC1IEscdoQKbRD 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: List-Subscribe: List-Unsubscribe: On Tue, Feb 27, 2024 at 05:55:35PM +0100, Pankaj Raghav (Samsung) wrote: > > > > > > > > you guys are both wrong, just use rounddown() > > > > > > Umm, what do you mean just use rounddown? rounddown to ...? > > > > > > We need to get index that are in PAGE units but aligned to min_order > > > pages. > > > > > > The original patch did this: > > > > > > index = mapping_align_start_index(mapping, iocb->ki_pos >> PAGE_SHIFT); > > > > > > Which is essentially a rounddown operation (probably this is what you > > > are suggesting?). > > > > > > So what willy is proposing will do the same. To me, what I proposed is > > > less complicated but to willy it is the other way around. > > > > Ok, I just found the code for mapping_align_start_index() - it is just a > > round_down(). > > > > Never mind; patch looks fine (aside from perhaps some quibbling over > > whether the round_down()) should be done before calling readahead or > > within readahead; I think that might have been more what willy was > > keying in on) > > Yeah, exactly. > > I have one question while I have you here. > > When we have this support in the page cache, do you think bcachefs can make > use of this support to enable bs > ps in bcachefs as it already makes use > of large folios? Yes, of course. > Do you think it is just a simple mapping_set_large_folios -> > mapping_set_folio_min_order(.., block_size order) or it requires more > effort? I think that's all that would be required. There's very little in the way of references to PAGE_SIZE in bcachefs.