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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 966E5C4707A for ; Fri, 21 May 2021 17:39:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47AC061168 for ; Fri, 21 May 2021 17:39:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47AC061168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B9CCD940022; Fri, 21 May 2021 13:39:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B4D1494001C; Fri, 21 May 2021 13:39:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C72B940022; Fri, 21 May 2021 13:39:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 674F394001C for ; Fri, 21 May 2021 13:39:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0570010FB9 for ; Fri, 21 May 2021 17:39:47 +0000 (UTC) X-FDA: 78165950814.14.A423185 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf24.hostedemail.com (Postfix) with ESMTP id DCB65A0001C0 for ; Fri, 21 May 2021 17:39:43 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id z4so9166323plg.8 for ; Fri, 21 May 2021 10:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=2t/VTlmdX7MCzosuH7B8AIXN75QL5Hs7N47wBxLop0k=; b=DE9GpRFMHtRsn4UCEx1NOlYgGeJWwXqUgwQc9CdGdlrdtrJEwsxa9h+VZb3kFX++6V Xf610fLpqT7B/nKxVTKcTL0ecCm1Gzg5fX21hQ7/i+DObpYMjFpJ1pq8ky5EhbuPFVny ya1uutDNPm4V1hymCIVuKcTCfkH8X2jHtZFiR1xDzXoQHUBozntnfJz+PDCOiTWlmJTu xUsDSOWVKaDaz85ERq+6+rAmI/HGBmOTHDc3G6imsOu0dNKJbAiZYWWDLLTXSTXZ4xtM UA5EqE7975MLZObeSv36Ff9/qHFJFTrtqALahsJ1BMHkOuRxEJZclsgIklRmJNElcP6E verQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=2t/VTlmdX7MCzosuH7B8AIXN75QL5Hs7N47wBxLop0k=; b=dfCtb/xl3qoA/lmdN5UogEbqNQ0VWK8K0FyoS02n2di18A4dmpLdsPvbucxB+Mynxh q6HVDtNOx5iW0+ZXeO51E58pk4TOeLxluXedsUIeSu8dxYOqHqOJqO6wRg734pGejtlI PPeL9/uKBiT6Bu6QuB+odMarn1cVhfl9v5Fz0qzcBluNpFQ5y63TlJ732JtdaNcotUsJ x6iAqNEreyvO3pPo9ZQRz2It9DYHQqS8y7Ru4u17xTPLf5Hmy9j6yudn7OprgYZ5ihzX 16DYY7aFNMQbbbWlo7CI8PwvRT5VQxVptxZ0inajhmL9JJZPD8G9nnBoMtBAaU34naij vFiw== X-Gm-Message-State: AOAM5325FABGvUyZbycGb1RNDpC3p1WPXMQf1FvnO1xEgF4CMrdMjLbH sASOhA/p09+RqoPe6bTeQSs= X-Google-Smtp-Source: ABdhPJwmUB8Thmjk4ox/YbEzRl3z4Y/TojQ1uKfnW81tv/KSC/gHxjJI/T16WkYKH92Ia+srmLPTmg== X-Received: by 2002:a17:902:d386:b029:f3:fa6:84a6 with SMTP id e6-20020a170902d386b02900f30fa684a6mr13436889pld.31.1621618785658; Fri, 21 May 2021 10:39:45 -0700 (PDT) Received: from google.com ([2620:15c:211:201:2a07:5416:42d3:6c55]) by smtp.gmail.com with ESMTPSA id z23sm4525590pjh.44.2021.05.21.10.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 10:39:45 -0700 (PDT) Date: Fri, 21 May 2021 10:39:42 -0700 From: Minchan Kim To: David Hildenbrand Cc: Andrew Morton , John Dias , LKML , Michal Hocko , Suren Baghdasaryan , linux-mm Subject: Re: [PATCH] mm: page_alloc: dump migrate-failed pages only at -EBUSY Message-ID: References: <20210519213341.2620708-1-minchan@kernel.org> <4c7104bc-6950-9334-a066-c01b92577b57@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4c7104bc-6950-9334-a066-c01b92577b57@redhat.com> X-Rspamd-Queue-Id: DCB65A0001C0 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=DE9GpRFM; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf24.hostedemail.com: domain of minchankim@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=minchankim@gmail.com X-Rspamd-Server: rspam03 X-Stat-Signature: 37sfr7sczxnzw8fx6dj37ttrw34xw46c X-HE-Tag: 1621618783-21873 Content-Transfer-Encoding: quoted-printable 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 Fri, May 21, 2021 at 10:08:15AM +0200, David Hildenbrand wrote: > On 20.05.21 22:51, Minchan Kim wrote: > > On Thu, May 20, 2021 at 09:28:09PM +0200, David Hildenbrand wrote: > > > Minchan Kim schrieb am Do. 20. Mai 2021 um 21:= 20: > > >=20 > > > > On Wed, May 19, 2021 at 02:33:41PM -0700, Minchan Kim wrote: > > > > > alloc_contig_dump_pages aims for helping debugging page migrati= on > > > > > failure by page refcount mismatch or something else of page its= elf > > > > > from migration handler function. However, in -ENOMEM case, ther= e is > > > > > nothing to get clue from page descriptor information so just > > > > > dump pages only when -EBUSY happens. > > > > >=20 > > > > > Signed-off-by: Minchan Kim > > > > > --- > > > > > mm/page_alloc.c | 3 ++- > > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > >=20 > > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > > > > index 3100fcb08500..c0a2971dc755 100644 > > > > > --- a/mm/page_alloc.c > > > > > +++ b/mm/page_alloc.c > > > > > @@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(s= truct > > > > compact_control *cc, > > > > >=20 > > > > > lru_cache_enable(); > > > > > if (ret < 0) { > > > > > - alloc_contig_dump_pages(&cc->migratepages); > > > > > + if (ret =3D=3D -EBUSY) > > > > > + alloc_contig_dump_pages(&cc->migratepages= ); > > > > > putback_movable_pages(&cc->migratepages); > > > > > return ret; > > > > > } > > > > > -- > > > > > 2.31.1.751.gd2f1c929bd-goog > > > > >=20 > > > >=20 > > > > Resend with a little modifying description. > > > >=20 > > > > From c5a2fea291cf46079b87cc9ac9a25fc7f819d0fd Mon Sep 17 00:00:0= 0 2001 > > > > From: Minchan Kim > > > > Date: Wed, 19 May 2021 14:22:18 -0700 > > > > Subject: [PATCH] mm: page_alloc: dump migrate-failed pages only a= t -EBUSY > > > >=20 > > > > alloc_contig_dump_pages aims for helping debugging page migration > > > > failure by elevated page refcount compared to expected_count. > > > > (for the detail, please look at migrate_page_move_mapping) > > > >=20 > > > > However, -ENOMEM is just the case that system is under memory > > > > pressure state, not relevant with page refcount at all. Thus, > > > > the dumping page list is not helpful for the debugging point of v= iew. > > > >=20 > > >=20 > > > what about -ENOMEM when migrating empty/free huge pages? I think th= ere is > > > value in having the pages dumped to identify something like that. A= nd it > > > doesn=E2=80=98t require heavy memory pressure to fail allocating a = huge page. > > >=20 > >=20 > > -ENOMEM means there is no memory to alloate destination page. > > How could it help dumping source pages in those case from dump_page > > content point of view? >=20 > You would spot a huge page in the source list (usually at first positio= n) > without any obvious migration blockers I assume? It was not a huge page case. >=20 > I'm wondering, did you actually run into this being suboptimal? If it's= a > real problem dumping too many stuff when running into -ENOMEM, fine wit= h me. > If it's a theoretical issue, I'd prefer to just keep it simple as is. That's exactly what I encountered. With -ENOMEM, it dumped bunch of pages on migratepages list. It was just useless with just consuming logbuffer since there are nothing much to investigate with dumping source pages.