Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4991186rdb; Fri, 15 Sep 2023 21:03:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEM5B2pWYWcQNTKZTvXVjxq0HXKbcARGfltQ6yTFiAj3GiMMg5ibLZKMWRb+IRWjoOlmY+h X-Received: by 2002:a05:6358:9185:b0:12f:158e:ed88 with SMTP id j5-20020a056358918500b0012f158eed88mr4923998rwa.22.1694837017257; Fri, 15 Sep 2023 21:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694837017; cv=none; d=google.com; s=arc-20160816; b=XcAfWK/jkJQohNF4Zqcco9fjfuAHfFMFFe6BOHhqe0CiNj1ca7+1/14p+wf9+6lb7i OKN55SWV5PkxiiiS01GyGH3jd7Ay9T3W1gfbgGQoFAe39xjiJEm/ZzvcZp2riJx7wD/a ymWF4WhpLk0Onpq6JMMjCLWnK4i+ofV5klou69iz5Ehn0hGrXSy2uFQMgqoFp1+747j/ mvu8pVX4nPBl/PPYctnUbSdHhrZFILwxhBnyG2+9C3tpaDcbaU7kuT7J8bSiQJhriAb2 96/oyWvB4SmshMy9qSxGewQ52XVLXsQ/RRDwO0c/0pNbUW3OrpqJcZsuLFLGbPi9vq8N OwqQ== 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=3APo23DtYMF4HiSm9np03AfVKr1TDxQPEqBIBU7EQLQ=; fh=kl+S4GAUWD1kOeoqBopscteh2mu3DZslcHc01dOJ6TI=; b=IQtQTvxBna1PEbUGWOp9IL7EFRFBE8Ea6lyUYasFKbQckvoF4TLngcVDLUnOtv6sfd sjynytiP5qON6hpZHtT0bhViXG7l7AHhYsdi8GCM2B4WuKDu7Qhn15bdcWdX12prsqiZ zGRQ0km8YboouAJkJuTyWooDdHL2aJQgFpsijb4AKWkNNzcAu5LsA/W5OKlRLSx2D2Gi CES2KLBVLsnscolkZZQRuvfvBCotPgr43blt+D25SaFn4kptUf+es112yvUPaI8F/x+f T6ZOD2eWlSmz3Ti5VXQmmxAUCi6JFXSZ3wj/SMZVueTcqQSvG9+HjCIS3sS/IADCOukM KSSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=Zj3MnwSG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id d4-20020a633604000000b00564ca42aad9si4278381pga.894.2023.09.15.21.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 21:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=Zj3MnwSG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 7446D8082852; Fri, 15 Sep 2023 11:50:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236700AbjIOSuK (ORCPT + 99 others); Fri, 15 Sep 2023 14:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236609AbjIOSti (ORCPT ); Fri, 15 Sep 2023 14:49:38 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1EF3A8C; Fri, 15 Sep 2023 11:47:53 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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-202.mailbox.org (Postfix) with ESMTPS id 4RnNJQ0N8tz9sZ5; Fri, 15 Sep 2023 20:39:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1694803158; 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=3APo23DtYMF4HiSm9np03AfVKr1TDxQPEqBIBU7EQLQ=; b=Zj3MnwSGDMAwBq1bun9wQMD03apsZ8TkPzzZY0G+xVuRFHlA8jTRS9j0z03rhiuPfuRL6p sz/dnlC30Ddq95aZ8BgLQPzAOrlr7XRSaj2o2j1LWlJXmR+xzOB4D1lfcoHYkXXJNM7T+e o1eXt+BU1FmCmk3Anh7cikxoynzKwfGc8hH7UoHccj4k2DZXzQFOkU0phBCRGBrFG42T8t rlNeZG/822yhWUKUgM45Id9Xd6OxjN5FfHbNRbbHF90yh5ppnDsJruqnEsC/WrQJlyPF8N aYOfhwR5VntP4ab9n0nA+F2XRQXfgH4LmqvrkX9lLSLR7mCEJyhlXYJSK5HJdQ== 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 09/23] filemap: use mapping_min_order while allocating folios Date: Fri, 15 Sep 2023 20:38:34 +0200 Message-Id: <20230915183848.1018717-10-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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 11:50:44 -0700 (PDT) From: Pankaj Raghav Allocate al teast mapping_min_order when creating new folio for the filemap in filemap_create_folio() and do_read_cache_folio(). Signed-off-by: Pankaj Raghav --- mm/filemap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 21e1341526ab..e4d46f79e95d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2502,7 +2502,8 @@ static int filemap_create_folio(struct file *file, struct folio *folio; int error; - folio = filemap_alloc_folio(mapping_gfp_mask(mapping), 0); + folio = filemap_alloc_folio(mapping_gfp_mask(mapping), + mapping_min_folio_order(mapping)); if (!folio) return -ENOMEM; @@ -3696,7 +3697,8 @@ static struct folio *do_read_cache_folio(struct address_space *mapping, repeat: folio = filemap_get_folio(mapping, index); if (IS_ERR(folio)) { - folio = filemap_alloc_folio(gfp, 0); + folio = filemap_alloc_folio(gfp, + mapping_min_folio_order(mapping)); if (!folio) return ERR_PTR(-ENOMEM); err = filemap_add_folio(mapping, folio, index, gfp); -- 2.40.1