Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2047967rbb; Tue, 27 Feb 2024 09:03:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXTsNuTHbdrpuYIAx/df8teVxk+SmQxU1R4OcIz+YKkOnsyrYC/t6QmiyU72n9vkuHCVdPfqdggAoGN3mBDjBrC/sDrxQwfn1+/DLeeCg== X-Google-Smtp-Source: AGHT+IE4JDOzJAv+5kER+r+6HrImCb0wLomP7oqV5aXYGRnP3F7Ae+6KgFJcV42BYARAnNy7doGu X-Received: by 2002:a05:620a:1990:b0:787:c398:61e6 with SMTP id bm16-20020a05620a199000b00787c39861e6mr4582892qkb.5.1709053423688; Tue, 27 Feb 2024 09:03:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709053423; cv=pass; d=google.com; s=arc-20160816; b=C20cqqtwIiKyFejlr9DBVqFCgwP0X3VjOJPLTsL1CyZRRancZHs8f0yyGYC4ev1GSg hmwMuh5SmcOeVd1+cmGudm61llkz7DUHbDhZU+qykOYwVxTmHwK/YLQ3biZ8pcNjQgAw wr2HHtsSS3Km4tx+dAUvJiNX/P6OrwNpqFkK2Hhrb3lHQQLh1viU/XnsIGKROOAhxz5L QWWYOtvOdcSslHcEaUW+VI1J+w3MPfEz6/8j8mgthPEUNT27/Y9xo1vDSotMmabmaIkw 7ksBzh7R9mIv5IXVRbpfm8PKWS4HwuPropCGwr3esw231t7oVQ6j0aMbnQULTHAS4ohY Hn3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=L7UKNUBGlTpDM+CMJiwE59d0Y/y96axVL+XtjpcRUAA=; fh=PT4hQYnNg5o4FqCvTjX0UpTz1i3unclzAQnPweUux9g=; b=RVWS4ayHaiGK+62m1cfIhDjY9NWpZZP7LuLAU/ITpoou2GOSLaQdH9anr4SWgOd9/X 1i6ZwtLnFh2CwlBDWGMPEnheJhm1AQdtVGlLWocIzufxxy+rCX6Z/u6rxViOy/vmIhyw hrQS2Fnnh6IUAaBKFSLbFzRJj+RSvZYXZnqzVS85rJmhCQ58S4BXXDPOXqhBPAr6IvS3 a2F7x046qNrp8ygZbCgS5dEm1skBozxX8woDneydyp+RoyyoxFzHfUMYTqe1Cfn+TNWu G6MxEZ6Qi/xpGJ9Dtt10Qt+t0o2z7E+3U82GBNLo1ItRr1eF/zriOUsD0iL75kSIqak4 mXew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Zwzw8Db3; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-83668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u21-20020ab05b15000000b007d969106c9bsi1021633uae.78.2024.02.27.09.03.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:03:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Zwzw8Db3; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-83668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A72421C240D2 for ; Tue, 27 Feb 2024 17:03:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 939C147A7D; Tue, 27 Feb 2024 17:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Zwzw8Db3" Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 061B82557F for ; Tue, 27 Feb 2024 17:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709053377; cv=none; b=EMRClSz4cphcKtgTXZQtRdxV5+dug2dg/M5ho9XZl42aNAMuX0V4wLfmSEp/0KHgzXRCUNmSOraxc1XiXIFNPD9nIPEwL1cfNKnEqT+ei0PjcNP9db8cbVeVLwvBKEDtBl7tT4Tu1nupGu6nRUY2zjxIum2Hm2LywWJi3xFHAqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709053377; c=relaxed/simple; bh=fYmViQBsuq3KWkkQSjDassbD/MSa99mQLTE6HIwVoXw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SLPOV+0oAEsEvnkKxFN0kuTR1OZnc24SnOjje1rk1vTyj1c8o/4+yNQTo2amDpea3CACxx8PmigjDmVw3bgb7o+rQ5GtqYJp4L+lTAngG9BbelxO76oI8hUEQcu2gwiT220OxHSa9k4hRY4Ciie28okbc3UjG75rlZ4n/E3QJn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Zwzw8Db3; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4zpsfvy3e4hkc4avvjjr34rgo7ggpd6hpflptmiauvxwm3dpvk@5wulihwpwbyp> X-Migadu-Flow: FLOW_OUT 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.