Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5047428rdb; Sat, 16 Sep 2023 00:12:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGz2U+fHKRvWKeGAcaREiIBmNWboUH1GbwhHDwJubBnoqYVHaNhqI3quR4a4fxTxQzPXfej X-Received: by 2002:a05:6a20:970e:b0:12f:dc31:a71e with SMTP id hr14-20020a056a20970e00b0012fdc31a71emr3549645pzc.56.1694848360115; Sat, 16 Sep 2023 00:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694848360; cv=none; d=google.com; s=arc-20160816; b=JYIX2aQj1khUmZPAQB+RdfmJE6Bbk35DeSvxVLMt/hcDEhTnfFXFnkfH1dUDjyaTWE xx21YMeLroMhOjMb+j1S4ecD+y5osN+1yAR7bvMaPkr7Az7ZnDhEROhG9KsfkRWeIt97 8N+jac6fTXujHhD7kjKYL1449Pd1mQSrqtE+HdMGbReeeYlWBPcLBNP7gu0BcdHaESAT wI2Nf6N00JoYngK5+zUx+miY6HSUo0RZqWzA3nc3SLS9u3Jl5X4kbxAA8zYoT2k041oI RGFjYVavwU3I+zhrMXmJnIGim6mP2GzG5io8/BPM8whG8vjysDIlxIXLSNEZCLJ9wIiM dt+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qYagWwQkQyBo9FUt+Wer66h9atojNQ2DWonnQYgzdlw=; fh=kl+S4GAUWD1kOeoqBopscteh2mu3DZslcHc01dOJ6TI=; b=08Ppdo86smnlPT6kCUJMmTCwUwAbATfqmH4cBXb8CBIExNu/2b0DneeTq7jQp9COFY F0SrPgBaYULOiUFmDvJ9WI9yW2uZXvlw8sQfnRwbk5NDDrlh6kCKIznQSDXinbpy5VHg 0UKNm0K+ru5rE6uz5jLY8FBlHDd/2vP/zXo/i8LrD80LsPBaaUGegeanvXpW8bfRGxtt HjnUKIdxkHYWxg/N36Nn89IWfUqygzldwADDB2V/sXTxLhvehvJle5YJ4NFxj/fiyfzv Uyc7ZWPf2wsKn7uJsiM4EF7l4uD3cnEjNKo+Gz9Y8Inj5uliQJchgsjBU2xXaGq8OvmC UZ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=sLkequQ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y7-20020a636407000000b00565448156afsi1585399pgb.715.2023.09.16.00.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 00:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=sLkequQ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BA7FC808206E; Fri, 15 Sep 2023 11:41:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236783AbjIOSka (ORCPT + 99 others); Fri, 15 Sep 2023 14:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236979AbjIOSkE (ORCPT ); Fri, 15 Sep 2023 14:40:04 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C863F4C06; Fri, 15 Sep 2023 11:39:20 -0700 (PDT) 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 ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4RnNJL12VYz9sTm; Fri, 15 Sep 2023 20:39:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1694803154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qYagWwQkQyBo9FUt+Wer66h9atojNQ2DWonnQYgzdlw=; b=sLkequQ37CkU3k8W1DxxgB42DpoCWPVkiye6O36mnozEtbvveaSpVg02AQr9gRNrsG1StT zaL/G92Pk3Q9LxMD3dVHNbwZKUF2uE0xvuy7ixhERejXQHjckMQRVs4nVmKTcZ8B4ZlwxF dilFyBmIzK3geH/C55u1tMzeAId6PQM20aaVRonwgd4u+BGaOLBKOVd7hyimLCr/FrViWj YBvOAyGNd9SQBuLQuz8bCS/+MMijxud/FLCWs8ijotAjn63u2NB1NyM8wO0y+syInk6R+Q VvQVj3aV97v3/+RLzo4tjrdpk9/BPKcdYe+8EcQcR29kNlkW4twTvSq1m+u2PQ== From: Pankaj Raghav To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: p.raghav@samsung.com, david@fromorbit.com, da.gomez@samsung.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, willy@infradead.org, djwong@kernel.org, linux-mm@kvack.org, chandan.babu@oracle.com, mcgrof@kernel.org, gost.dev@samsung.com Subject: [RFC 08/23] filemap: align the index to mapping_min_order in filemap_get_folios_tag() Date: Fri, 15 Sep 2023 20:38:33 +0200 Message-Id: <20230915183848.1018717-9-kernel@pankajraghav.com> In-Reply-To: <20230915183848.1018717-1-kernel@pankajraghav.com> References: <20230915183848.1018717-1-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 11:41:08 -0700 (PDT) From: Luis Chamberlain Align the index to the mapping_min_order number of pages while setting the XA_STATE in filemap_get_folios_tag(). Signed-off-by: Luis Chamberlain --- mm/filemap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 15bc810bfc89..21e1341526ab 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2280,7 +2280,9 @@ EXPORT_SYMBOL(filemap_get_folios_contig); unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start, pgoff_t end, xa_mark_t tag, struct folio_batch *fbatch) { - XA_STATE(xas, &mapping->i_pages, *start); + unsigned int min_order = mapping_min_folio_order(mapping); + unsigned int nrpages = 1UL << min_order; + XA_STATE(xas, &mapping->i_pages, round_down(*start, nrpages)); struct folio *folio; rcu_read_lock(); -- 2.40.1