Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp323239lqb; Thu, 29 Feb 2024 01:52:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUCrp+6/8ArCezuqixFvV3m2VX8r7hU8x6jronTFdNapRKcgQFwthnXj2/Ytk1Y9DapiE9pK1vGrmzsbvczybFww/dPBcF6Z34gN81WsA== X-Google-Smtp-Source: AGHT+IHqeuH5c86k0qF9GJsO+XVhKk69Xv8udyi17wVd9WL8hHqvc3j/uT3Ix1BEbHF74hOUqyVN X-Received: by 2002:a05:6402:b49:b0:565:4e5c:2815 with SMTP id bx9-20020a0564020b4900b005654e5c2815mr1070608edb.24.1709200330238; Thu, 29 Feb 2024 01:52:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709200330; cv=pass; d=google.com; s=arc-20160816; b=k/VlN3ioyM8SGou0jlJmtgEsJlCPL8qgNj7ybAXMURKe/dyCI1PY52fcuNTdkL+Af2 o5yZkAEdxncU30RsVL6ePug6rKLV7j19f0cBe/FXPuqJAHYya73vxBskLaSJp/O1C2OW lITenCpFBORyb58z1EpJi0h9Fc+SzA4CLxuOWcCE4/5vBbkdlrshSS+9gULLGPsdrRsW TEjSba0Tee3hhHiZc3Ad28du/qJXg+ArgYWmNCyp9Mnx472bifm6v//oZXEJaXiiAeYr w4nYnhLaWH5WTmfqi7oqLHYzbWtW8o44NhC0IuvNesL/3L+m8eEMXtYK6EQyhU2lqyyt Umgg== 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:date:dkim-signature; bh=zXehXAXIEmYYeqDh0Eogjo6VOr6C1m5T64ivWJ24wcQ=; fh=/b6YGcPejWDNezti1EBZvRP+LSZiTVKUOaRgS5FhYnQ=; b=oGfFqs2PpJh8ox6wgHjnOFqiLB231eH8cR9yHxbE5VOjyVYvOeKDLJdhyBKJcl7Bba 12c1z0JetN77e3UK5hz1Vu9UYdZf3R5z2SnN2ys1d8H587V/HHuGT7OF2kR8PNrZoBIf g6S+M+HxPiw/fp+u4tO9NjFKkm70nOab0040fHBjWcFtKzmTCjMonZZA9qH6+lrCBqTD IIc8rbgQT2ANeIf+ZajmipFqctISymOlmvprpFajGwb/r/FuBcqT5c9gujWYtOae4qRz ccn3EsgAl/cuvR4YuVKyr9H+Gydycr5dFN96ykXYp8aqL5wRfS53TGT4Nv0dywtRs7C3 07bQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b="Vxr/hBQE"; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-83661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83661-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e6-20020a056402190600b005665d76147bsi416834edz.333.2024.02.29.01.52.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 01:52:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b="Vxr/hBQE"; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-83661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83661-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 57D481F27A87 for ; Tue, 27 Feb 2024 16:56:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16D034E1C4; Tue, 27 Feb 2024 16:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="Vxr/hBQE" Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (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 98BF147F60; Tue, 27 Feb 2024 16:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.161 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709052950; cv=none; b=RkxH9BYDybyj6n2KEEVWVNzqLfEnLHUWETiIvtcp2j+pZ7a19vhB2tfC1BEWdvwLnWFeuquxesCawbpH/Muf4n1wciru6eqXoZRxXvz7s3wsqFmjdrH2jLKQpdPIIrxQMjQoYgl0/bRXd93vZD0VLin8cD/q+9uH0SwY3hijRDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709052950; c=relaxed/simple; bh=na65zOZl5XTP/QEShmS7vfHvQhS99riKElDJy2bCLBs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OIqNIzgM4avI41bjNSQu7870pd4muCpf00XjVoHXsMUQd3SueK0QWwM7DQ3Q6/l+JEQxWBiZ52aYcAps7HeCKZMNo71OMyfwvUkS6Xv8qeu/IWy6xmQKpFZEnl2W0iIfHAxOJsXQIipkPn1UubhpTD8GTE5j+KNLn66k/5ik/Gk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=Vxr/hBQE; arc=none smtp.client-ip=80.241.56.161 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4TkkBg1LnFz9srf; Tue, 27 Feb 2024 17:55:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1709052939; 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=zXehXAXIEmYYeqDh0Eogjo6VOr6C1m5T64ivWJ24wcQ=; b=Vxr/hBQEi90TuscbFQV/HaSCLfVBeGFcYfC9pSGkw1JM1bJ7O6/8lGar26+RcLW4OlbUlb DcQMfg9YhaMLL/vzJAb9CL7mQl5zjEStqSA+4G0ClSj248X9b5LTmqY5I8vxXJXuPystWs 2H0Y+NlvZAP0b9UxUDnUqvV9nflG3WvAf3/T/hmg/v9EHi86TArZNEBmuFT4WYyRkil/NY zSZ5NzUamAXJWaJYjglAmwSCPPwhiKKFsucsuqthi4y7vcyWuIIL6hPa2N1MewHvnwAUSs mtxNXlWOjT8BPeJM3cdi1rClYkw2Fuc6kklS03TgcDEEtCLnQA6beIK114JV8w== Date: Tue, 27 Feb 2024 17:55:35 +0100 From: "Pankaj Raghav (Samsung)" To: Kent Overstreet 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: <4zpsfvy3e4hkc4avvjjr34rgo7ggpd6hpflptmiauvxwm3dpvk@5wulihwpwbyp> References: <20240226094936.2677493-1-kernel@pankajraghav.com> <20240226094936.2677493-4-kernel@pankajraghav.com> <37kubwweih4zwvxzvjbhnhxunrafawdqaqggzcw6xayd6vtrfl@dllnk6n53akf> 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: > > > > > > 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? 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?