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 X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32C35C433EF for ; Mon, 6 Sep 2021 14:40:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ACE0B60F45 for ; Mon, 6 Sep 2021 14:40:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ACE0B60F45 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 07F53900002; Mon, 6 Sep 2021 10:40:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 006696B0072; Mon, 6 Sep 2021 10:40:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC1A9900002; Mon, 6 Sep 2021 10:40:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id C67376B0071 for ; Mon, 6 Sep 2021 10:40:30 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7708418150F28 for ; Mon, 6 Sep 2021 14:40:30 +0000 (UTC) X-FDA: 78557409420.18.C2037BE Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf14.hostedemail.com (Postfix) with ESMTP id 068B96001984 for ; Mon, 6 Sep 2021 14:40:29 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9A88322169; Mon, 6 Sep 2021 14:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1630939228; 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=rFhvnpOKr3OKxjpJTREq9p7eh5KGXFCWvrRzUPaUhm0=; b=dFGHE5sdH1dNgXQGg1O0NlubYKiVn/meKT/MoyTffwWzVylzr/u9DDrkehoUQq7rDfUhcx o22mO17uPDdyqJofXLJx7mWJTWbAXMmbNcigsE7x38wG4/+Bbe1861IM838EHa9KYH5r8d b0N1PPDFpZsVdSNj10aqaUaI6seCkrw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1630939228; 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=rFhvnpOKr3OKxjpJTREq9p7eh5KGXFCWvrRzUPaUhm0=; b=vN4oeiD+BwKEbgagD2S3l00A+rhQ89C4C0jmNvaa/GV8+e/cCyKT+w6dar8yFX/iVf4aaK E7BOA5dRp+PVsLCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6F15913C29; Mon, 6 Sep 2021 14:40:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IBkmGlwoNmFvYgAAMHmgww (envelope-from ); Mon, 06 Sep 2021 14:40:28 +0000 Message-ID: <597a7731-3692-01b9-9e71-ba265246cc1a@suse.cz> Date: Mon, 6 Sep 2021 16:40:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: [PATCH RESEND 0/8] hugetlb: add demote/split page functionality Content-Language: en-US To: Mike Kravetz , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand , Michal Hocko , Oscar Salvador , Zi Yan , Muchun Song , Naoya Horiguchi , David Rientjes , Hillf Danton References: <20210816224953.157796-1-mike.kravetz@oracle.com> <20210816162749.22b921a61156a091f3e1d14d@linux-foundation.org> <20210816184611.07b97f4c26b83090f5d48fab@linux-foundation.org> <10d86c18-f0cf-395f-4209-17ac71b9fc03@oracle.com> <2d826470-d345-0196-1359-b79ed08dfc66@oracle.com> <02a1a50f-4e7c-4eb7-519c-35b26ec2c6af@oracle.com> From: Vlastimil Babka In-Reply-To: <02a1a50f-4e7c-4eb7-519c-35b26ec2c6af@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dFGHE5sd; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=vN4oeiD+; dmarc=none; spf=pass (imf14.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 068B96001984 X-Stat-Signature: wat148kws7h1owomc7jw3c5kb1w1pumr X-HE-Tag: 1630939229-551588 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 9/2/21 20:17, Mike Kravetz wrote: > On 8/30/21 3:11 AM, Vlastimil Babka wrote: >> On 8/28/21 01:04, Mike Kravetz wrote: >>> On 8/27/21 10:22 AM, Vlastimil Babka wrote: >>> I 'may' have been over stressing the system with all CPUs doing file >>> reads to fill the page cache with clean pages. I certainly need to >>> spend some more debug/analysis time on this. >> >> Hm that *could* play a role, as these will allow reclaim to make progress, but >> also the reclaimed pages might be stolen immediately and compaction will return >> COMPACT_SKIPPED and in should_compact_retry() we might go through this code path: >> >> /* >> * compaction was skipped because there are not enough order-0 pages >> * to work with, so we retry only if it looks like reclaim can help. >> */ >> if (compaction_needs_reclaim(compact_result)) { >> ret = compaction_zonelist_suitable(ac, order, alloc_flags); >> goto out; >> } >> >> where compaction_zonelist_suitable() will return true because it appears >> reclaim can free pages to allow progress. And there are no max retries >> applied for this case. >> With the reclaim and compaction tracepoints it should be possible to >> confirm this scenario. > > Here is some very high level information from a long stall that was > interrupted. This was an order 9 allocation from alloc_buddy_huge_page(). > > 55269.530564] __alloc_pages_slowpath: jiffies 47329325 tries 609673 cpu_tries 1 node 0 FAIL > [55269.539893] r_tries 25 c_tries 609647 reclaim 47325161 compact 607 > > Yes, in __alloc_pages_slowpath for 47329325 jiffies before being interrupted. > should_reclaim_retry returned true 25 times and should_compact_retry returned > true 609647 times. > Almost all time (47325161 jiffies) spent in __alloc_pages_direct_reclaim, and > 607 jiffies spent in __alloc_pages_direct_compact. > > Looks like both > reclaim retries > MAX_RECLAIM_RETRIES > and > compaction retries > MAX_COMPACT_RETRIES > Yeah AFAICS that's only possible with the scenario I suspected. I guess we should put a limit on compact retries (maybe some multiple of MAX_COMPACT_RETRIES) even if it thinks that reclaim could help, while clearly it doesn't (i.e. because somebody else is stealing the page like in your test case).