From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD7AAC433F5 for ; Fri, 27 May 2022 17:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354306AbiE0RaN (ORCPT ); Fri, 27 May 2022 13:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354332AbiE0RaG (ORCPT ); Fri, 27 May 2022 13:30:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4AC384DF4D for ; Fri, 27 May 2022 10:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653672604; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cefitV8uX/6feCDJMEsFPG76wT6MNXuBQFQNrynOdh0=; b=B8VKkZamol0rMkxsAtoG6KQ9DYFjp5e1bvqXaTNY1mdtUHd0n/xJfA9IhUTi0WYQ/haFeE 9WJcxylxlPL8B4LXt/9xlr8vMOnKuZyQAqQiEdZ5/BsctVrXGYqImZwqRND79cj13P3tmr cUBRwcjcpaI06eCRwjOg4OdYGQnbwgE= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-r7V0ERizO7qEEbhr36CngA-1; Fri, 27 May 2022 13:30:03 -0400 X-MC-Unique: r7V0ERizO7qEEbhr36CngA-1 Received: by mail-lj1-f199.google.com with SMTP id a8-20020a2e7f08000000b00253c7e7f572so1435866ljd.1 for ; Fri, 27 May 2022 10:30:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:date:mime-version:user-agent:cc :subject:content-language:to:references:in-reply-to :content-transfer-encoding; bh=cefitV8uX/6feCDJMEsFPG76wT6MNXuBQFQNrynOdh0=; b=EnBs+VMjvpQrv5TEogoL1LUB7RcyKduKp9jyKiZf/awBlk80/ZTzePIPhPlehxWpmz sY2vzPXId2qdJCtFwKZAVAifxtl/5cPeYGVvv/YVZAN/KhikNm5LO3Q+S2YlEwYCKVAR Rm3tkup0KCPnW5NqL8/HPsismSSfuaCdmDD0VBplQN+zivyU2JBQysQX5wIVO75+cD5W dc+FQY+8++2lmDb+Ht3gGmKxsCFPPGDK4HnC3VGSTuDa0fqxygFEQLaSyBFwyu5OwoL4 Lpn5MKZ8Jy2u8H8BDFu5snOHavJ23Th6/TNY83oXKSpnHUQ0YebFlwR011xaYBEjKbgR Uj5w== X-Gm-Message-State: AOAM53060jOCf5Sq/kUltQVNOBHCvhihKOnd9qdk4UyvvCkQzfRlUgiY kdT77t9fKCAllmdMDRjGZboCAcN8YwG6x7Ht3eJCTVEosqR9ClduAk0aP0Kx6mpk2LEfUATcTa6 Q3bcErFePIEfBt1PjvqUohZXa X-Received: by 2002:a05:6512:1189:b0:478:8b81:d3b2 with SMTP id g9-20020a056512118900b004788b81d3b2mr13924870lfr.247.1653672601592; Fri, 27 May 2022 10:30:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHy8Z11UyDeJF1PfQehPGRpRB2pdmd+NOjG8IQ3dm26jx4WasEfdOhzMuSV+x3EkYQK3j+tQ== X-Received: by 2002:a05:6512:1189:b0:478:8b81:d3b2 with SMTP id g9-20020a056512118900b004788b81d3b2mr13924859lfr.247.1653672601309; Fri, 27 May 2022 10:30:01 -0700 (PDT) Received: from [192.168.0.50] (87-59-106-155-cable.dk.customer.tdc.net. [87.59.106.155]) by smtp.gmail.com with ESMTPSA id bj38-20020a2eaaa6000000b0025541ce7ef1sm134106ljb.11.2022.05.27.10.29.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 May 2022 10:30:00 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <16e1aba3-99af-9cc9-88d5-2cf0f1ed618b@redhat.com> Date: Fri, 27 May 2022 19:29:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Cc: brouer@redhat.com, "Darrick J. Wong" , Dave Chinner , Jan Kara , Vlastimil Babka , Chuck Lever , Linux-NFS , Linux-MM , Linux-XFS , LKML Subject: Re: [PATCH] mm/page_alloc: Always attempt to allocate at least one page during bulk allocation Content-Language: en-US To: Mel Gorman , Andrew Morton References: <20220526091210.GC3441@techsingularity.net> In-Reply-To: <20220526091210.GC3441@techsingularity.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/05/2022 11.12, Mel Gorman wrote: > Peter Pavlisko reported the following problem on kernel bugzilla 216007. > > When I try to extract an uncompressed tar archive (2.6 milion > files, 760.3 GiB in size) on newly created (empty) XFS file system, > after first low tens of gigabytes extracted the process hangs in > iowait indefinitely. One CPU core is 100% occupied with iowait, > the other CPU core is idle (on 2-core Intel Celeron G1610T). > > It was bisected to c9fa563072e1 ("xfs: use alloc_pages_bulk_array() for > buffers") but XFS is only the messenger. The problem is that nothing > is waking kswapd to reclaim some pages at a time the PCP lists cannot > be refilled until some reclaim happens. The bulk allocator checks that > there are some pages in the array and the original intent was that a bulk > allocator did not necessarily need all the requested pages and it was > best to return as quickly as possible. This was fine for the first user > of the API but both NFS and XFS require the requested number of pages > be available before making progress. Both could be adjusted to call the > page allocator directly if a bulk allocation fails but it puts a burden on > users of the API. Adjust the semantics to attempt at least one allocation > via __alloc_pages() before returning so kswapd is woken if necessary. > > It was reported via bugzilla that the patch addressed the problem and > that the tar extraction completed successfully. This may also address > bug 215975 but has yet to be confirmed. > > BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216007 > BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215975 > Fixes: 387ba26fb1cb ("mm/page_alloc: add a bulk page allocator") > Signed-off-by: Mel Gorman > Cc: # v5.13+ > --- > mm/page_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Change looks good, and I checked page_pool will be fine with this change :-) Acked-by: Jesper Dangaard Brouer > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 0e42038382c1..5ced6cb260ed 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5324,8 +5324,8 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid, > page = __rmqueue_pcplist(zone, 0, ac.migratetype, alloc_flags, > pcp, pcp_list); > if (unlikely(!page)) { > - /* Try and get at least one page */ > - if (!nr_populated) > + /* Try and allocate at least one page */ > + if (!nr_account) > goto failed_irq; > break; > } >