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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 522C5C433EF for ; Fri, 27 May 2022 17:30:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C1478D0005; Fri, 27 May 2022 13:30:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 945BF8D0002; Fri, 27 May 2022 13:30:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 798E28D0005; Fri, 27 May 2022 13:30:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6B4598D0002 for ; Fri, 27 May 2022 13:30:05 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 484083570D for ; Fri, 27 May 2022 17:30:05 +0000 (UTC) X-FDA: 79512211170.20.D78C615 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 15E344003C for ; Fri, 27 May 2022 17:29:32 +0000 (UTC) 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-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-Ae34UoHZMsuuax1ehwTDWA-1; Fri, 27 May 2022 13:30:03 -0400 X-MC-Unique: Ae34UoHZMsuuax1ehwTDWA-1 Received: by mail-lf1-f69.google.com with SMTP id p36-20020a05651213a400b004779d806c13so2263041lfa.10 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=QKDpNO6XpjTifUSzdFjtbdg/cPakKqX2MixPRISEWb4jFF9h0WNqD1vGmPF3uVhYp5 FLsaI+vqQNS/9NYcqTRjPQniMVUzpIvvaCfEhVrjmSI6k7q7DER/59pSVvrD2RdNsw2Q jVoFkOA+vu+zq8uNqZQn6Ai3m/l9AwG6pS57yIYirCFyR5Sz7QXYLYOrjJN29JnMkfY9 PJR318NIZ7ZSsUqHoqQYU5cTrpEoysfkpP3HDpOiDSChGHWUduhz5F5eoAPvUEiaXgqz D93uvwSz8gPWAb0tmFUzjSTxcSiGbIaZEp16YhoZ6IxGSmGbQyTmVQMQpvU5nOQcqvFC iuBQ== X-Gm-Message-State: AOAM530uYLSgqNSYNgcD98EDU0pwdghsidD0fDhhJMNp5NZNykZK8yvg fYkk2V03tD4PJ7jDtaEq4p/7ZELyB4nE7HV6hfAizfxNSJVxhUpJl1Djh9qlzCxuWXwMlD2iOOv 2klM1jNgBMi4= X-Received: by 2002:a05:6512:1189:b0:478:8b81:d3b2 with SMTP id g9-20020a056512118900b004788b81d3b2mr13924881lfr.247.1653672601621; 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 To: Mel Gorman , Andrew Morton References: <20220526091210.GC3441@techsingularity.net> In-Reply-To: <20220526091210.GC3441@techsingularity.net> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Stat-Signature: 5fh4gk85fykshri4kfa5bs3u91c1xdes X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=B8VKkZam; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf17.hostedemail.com: domain of jbrouer@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=jbrouer@redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 15E344003C X-HE-Tag: 1653672572-535815 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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; > } >