Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3104677rdb; Tue, 13 Feb 2024 07:05:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXwGfOCuA6dZULPioFnxQOikBvMJc/PBQ5Ws54vU2A0y95bucCWWSN5BExGaqGct8GWNyBE88/UvjxW8DYrJgVBHgrAmFTSRm+YygR67A== X-Google-Smtp-Source: AGHT+IGF/8p+N7LBkblPDmVKW9+Z1a0+aDrAHIOBoil0QxewPyM1waSKEOVaDPgQT7gI4kMxzYMf X-Received: by 2002:a17:902:db09:b0:1db:4227:78c4 with SMTP id m9-20020a170902db0900b001db422778c4mr1759442plx.9.1707836729567; Tue, 13 Feb 2024 07:05:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707836729; cv=pass; d=google.com; s=arc-20160816; b=N7O7szHftMXBkc2wbK1fjx2S9kE+L1GU+S3bVXJ2wstYaYieDggOEqYonOz/r2ctLR JyYY7a52rmJdfs+HAQxs6iKfdji+cB405WhWM+hjSNyTq7JuZ+JzEcSyBXsRU+0L3uMe ZRxNwNs1cZyEnZ9ikz1GD6eH7t6OYraNM4IsaD8nXeBJbphe2RzZniZFBKU3RU7NGjdk X9uONiXnDHP7duQGnB0O6bD1wQ5HIivRA4Dol3LJDt7lc9oTgQ4IH2na8aAzaz/Fx5uP Jc5gILIHJuSyBk27Y2TaV+Upf8e/0+Oj8Far0YY6cdC4UBl66VrM9woZPICyDHRNawNe LIrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=OSAPi76ZfKEBUK44Kk9m2ondarSlgg03teP4kt0h9ts=; fh=h+LgYs0YpA7pki9jUycppMX87ZA6L7gw+8g9Q+RT4Mg=; b=gjlS03GCE6wKY12JkEy/Mr+orynyzTiS7sJriMd1RNr3aM7eGVfOjqOVsoMl0GymG7 jUS/E/RX+eKOg9Q3CEtkuKvwaipGy9rf7exMVWufp2/Vl0zRJ0fFZ8xoJEJYTLL+1p2x D9hHfNZ9j85KnogtUg+T0tX7YzOYgy5pHIZpiSB7hKZk09f875hXTUI5gMfW2KejhiM0 iyDorPpaSl1OWmMBVY8+kYv/9saVS29HErVudKP/qpwN6QQp7GL/k2uZ3kvICITmZ7CM UGZJ52xr7xp+htY8/PKmp+rnL7yu5o32PAP+PfUe7tjuDVUZOkIfl/3L87XlghA+e5ys Xzcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TsmF6EuW; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TsmF6EuW; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-63748-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63748-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de X-Forwarded-Encrypted: i=2; AJvYcCWQzrd1fs9yHVulxCw0aX77MC712apCi59urnOUZC6HUkIzVropitynJ1N8JKAfU+aq9nsxEH9J1H00XdkNwQaVmMJVX3SFFyh402u8Xw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x15-20020a170902a38f00b001db3b8d4823si971795pla.648.2024.02.13.07.05.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 07:05:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63748-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TsmF6EuW; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TsmF6EuW; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-63748-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63748-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EA83F2852C2 for ; Tue, 13 Feb 2024 15:01:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24B095F87B; Tue, 13 Feb 2024 14:58:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TsmF6EuW"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="4IzAiNJu"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TsmF6EuW"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="4IzAiNJu" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 838055F55E; Tue, 13 Feb 2024 14:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707836316; cv=none; b=LEUAcdCK4ujZCCf/SlLawQtgc6b+1qWEsJIjbRw5vkSUq+dJJhUFXlpGbrjX0A91zvA/CGyAsN3MXeTqACz+Mjd+MV74CP+2vdTuajxdIJ8UuXlVxRn4uizu0Z9PR6+s02wNmR6/jnKFwoLYCeCH9e3L3MxEvFclVRv/AP+Zpac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707836316; c=relaxed/simple; bh=n+9HwZfX+sU+0Q/HJpA//NT6ZKbLNYj5VpalvoNb0KY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Tw+UEQ04QsMulruR85OjN9YxJYaZ+rAmbrL9SxlK3oXkMl1mMdASRnIsG2dYRgnnxpv3+1uRfluLgROiIauF5Pkyjd1JwN2WO7vGFrliwI1UpK6/Xr8qlg5onBQmaeEpmnH1J2CiO3TiUjBs86Mt/+7NmC3AIFvjLux6SMv4n2g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TsmF6EuW; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=4IzAiNJu; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TsmF6EuW; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=4IzAiNJu; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id AA9FE1FCDB; Tue, 13 Feb 2024 14:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707836312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OSAPi76ZfKEBUK44Kk9m2ondarSlgg03teP4kt0h9ts=; b=TsmF6EuW1/ZrDEQnj5xa/n18uHulfwkLO6rU++JFQbmWcTs8JRISjd0e0DYJCt93M8Q3Lq 9xnDoEfMbslmTO8DqClxTOLoIkxUBw2BOdrCOKwqSEu3Y414rDadOzOFwAoj+Ikh4kV//E YuKVrwmP6GcFw3WmUC0+jb1CcBYwqWw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707836312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OSAPi76ZfKEBUK44Kk9m2ondarSlgg03teP4kt0h9ts=; b=4IzAiNJu0NaYcOYhd5h+T7ewe3kM8czpxtzkUT374zxrHQPrVhKL+RoLYylPryY2l0GzID Od3wT3xopUGMH0Cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707836312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OSAPi76ZfKEBUK44Kk9m2ondarSlgg03teP4kt0h9ts=; b=TsmF6EuW1/ZrDEQnj5xa/n18uHulfwkLO6rU++JFQbmWcTs8JRISjd0e0DYJCt93M8Q3Lq 9xnDoEfMbslmTO8DqClxTOLoIkxUBw2BOdrCOKwqSEu3Y414rDadOzOFwAoj+Ikh4kV//E YuKVrwmP6GcFw3WmUC0+jb1CcBYwqWw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707836312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OSAPi76ZfKEBUK44Kk9m2ondarSlgg03teP4kt0h9ts=; b=4IzAiNJu0NaYcOYhd5h+T7ewe3kM8czpxtzkUT374zxrHQPrVhKL+RoLYylPryY2l0GzID Od3wT3xopUGMH0Cw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8587C13404; Tue, 13 Feb 2024 14:58:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id le0RIJiDy2VlMwAAD6G6ig (envelope-from ); Tue, 13 Feb 2024 14:58:32 +0000 Message-ID: <617c710c-6b61-46cf-b507-4c16c9d8e9e4@suse.de> Date: Tue, 13 Feb 2024 15:58:28 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC v2 03/14] filemap: use mapping_min_order while allocating folios Content-Language: en-US To: "Pankaj Raghav (Samsung)" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: mcgrof@kernel.org, gost.dev@samsung.com, akpm@linux-foundation.org, kbusch@kernel.org, djwong@kernel.org, chandan.babu@oracle.com, p.raghav@samsung.com, linux-kernel@vger.kernel.org, willy@infradead.org, linux-mm@kvack.org, david@fromorbit.com References: <20240213093713.1753368-1-kernel@pankajraghav.com> <20240213093713.1753368-4-kernel@pankajraghav.com> From: Hannes Reinecke In-Reply-To: <20240213093713.1753368-4-kernel@pankajraghav.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.87 X-Spamd-Result: default: False [-1.87 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.58)[81.42%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[14]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Flag: NO On 2/13/24 10:37, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > filemap_create_folio() and do_read_cache_folio() were always allocating > folio of order 0. __filemap_get_folio was trying to allocate higher > order folios when fgp_flags had higher order hint set but it will default > to order 0 folio if higher order memory allocation fails. > > As we bring the notion of mapping_min_order, make sure these functions > allocate at least folio of mapping_min_order as we need to guarantee it > in the page cache. > > Add some additional VM_BUG_ON() in page_cache_delete[batch] and > __filemap_add_folio to catch errors where we delete or add folios that > has order less than min_order. > > Signed-off-by: Pankaj Raghav > Signed-off-by: Luis Chamberlain > --- > mm/filemap.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes