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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, 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 3AF4FC433ED for ; Fri, 21 May 2021 08:08:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C5EA6611AD for ; Fri, 21 May 2021 08:08:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5EA6611AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 51E5E8E0023; Fri, 21 May 2021 04:08:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CE918E0022; Fri, 21 May 2021 04:08:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3222B8E0023; Fri, 21 May 2021 04:08:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id F28DC8E0022 for ; Fri, 21 May 2021 04:08:20 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6B31A181AF5C2 for ; Fri, 21 May 2021 08:08:20 +0000 (UTC) X-FDA: 78164510760.02.5852C17 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf04.hostedemail.com (Postfix) with ESMTP id C17222C2 for ; Fri, 21 May 2021 08:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621584499; 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=0ioSqPukqM0EZIJQNY+nqzk8IymOGxLsSyLbLH6KWwQ=; b=ZwV/NlFuAQ7Iq2ko28Sqr951GRsvqc6jiJw1wF9yRDGfdF00pV4K/2Y2w4ZU3/XAzsI34g WBnLdQgGu4k26B8G6ep/diE0QnRRvp3kk8/GIcl8iydzRA+tH95dlEvDlxR8uxdzMtYIDz aKgsGKvSLZRHZFcNI3csWfBKfcEv/Xo= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-480-wyJNTXQJMi--tZVoIEFGGg-1; Fri, 21 May 2021 04:08:18 -0400 X-MC-Unique: wyJNTXQJMi--tZVoIEFGGg-1 Received: by mail-wr1-f69.google.com with SMTP id a5-20020a5d6ca50000b029011035a261adso9088401wra.17 for ; Fri, 21 May 2021 01:08:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0ioSqPukqM0EZIJQNY+nqzk8IymOGxLsSyLbLH6KWwQ=; b=eePpH1XA+jeRYSyL/87+DNd9NPYid67H6PreGpgXrQjRnfQe72sTElNvaxT3b2x9C4 6l7QnZ8nAN/ggQylzpT4Wo5u8jGEK0D/gCdG6A6l4/GwS1VP/q9//XFdr7MXDeixnUCN AKJsS7RUm6Jdw7fC78neHFFy7uWZ+DWH6X1WOgZ8j7nBCBO0/v8C7uCR62anfSujWTqz UnE2OE2jfwfMQHQQO8A5hSG2BPgv1xKoUSXAO76CyVZZ6G0GRdX2tkmqw3+53QhxVfq8 5eJD1XnOmxw8iBH8+aZzlifQhl3IgMAEgOco42ky3eJ92JkJjVRDobBZQzOWDbii0Q7N Qn7g== X-Gm-Message-State: AOAM531EZIE4/NckTzrTe28CZHzLBj6TgHAf39P4pK0LLmSqs4+GB4s2 GwPi7Nw5dQaUiKHwlTjC6zIcKwyDgxP+Xu7PHiEoloEnh5NKKi9yCvOrS2ZuXkOJw8WaxPKY1Lf CemUwPUyr3bOUD5yKKVdVC9+Gcby411vjGA2nfGHhRcdffYmQwPFf5ry0Heg= X-Received: by 2002:a05:600c:4f4e:: with SMTP id m14mr7891981wmq.164.1621584496736; Fri, 21 May 2021 01:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyMtHnMtnBDkXbglc8FJyWOVqwY8TTcC1T+QXa1gWNAOrwVug1xH6DFbmKf39M5cSqCCqcpw== X-Received: by 2002:a05:600c:4f4e:: with SMTP id m14mr7891945wmq.164.1621584496426; Fri, 21 May 2021 01:08:16 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6502.dip0.t-ipconnect.de. [91.12.101.2]) by smtp.gmail.com with ESMTPSA id x13sm1180497wro.31.2021.05.21.01.08.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 May 2021 01:08:16 -0700 (PDT) Subject: Re: [PATCH] mm: page_alloc: dump migrate-failed pages only at -EBUSY To: Minchan Kim Cc: Andrew Morton , John Dias , LKML , Michal Hocko , Suren Baghdasaryan , linux-mm References: <20210519213341.2620708-1-minchan@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: <4c7104bc-6950-9334-a066-c01b92577b57@redhat.com> Date: Fri, 21 May 2021 10:08:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ZwV/NlFu"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf04.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C17222C2 X-Stat-Signature: 7rtisu6fu6f8jc4y7d47eonqeyhdfyji X-HE-Tag: 1621584498-321510 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 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: >> >>> On Wed, May 19, 2021 at 02:33:41PM -0700, Minchan Kim wrote: >>>> alloc_contig_dump_pages aims for helping debugging page migration >>>> failure by page refcount mismatch or something else of page itself >>>> from migration handler function. However, in -ENOMEM case, there is >>>> nothing to get clue from page descriptor information so just >>>> dump pages only when -EBUSY happens. >>>> >>>> Signed-off-by: Minchan Kim >>>> --- >>>> mm/page_alloc.c | 3 ++- >>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> 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(struct >>> compact_control *cc, >>>> >>>> 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 >>>> >>> >>> Resend with a little modifying description. >>> >>> From c5a2fea291cf46079b87cc9ac9a25fc7f819d0fd Mon Sep 17 00:00:00 20= 01 >>> From: Minchan Kim >>> Date: Wed, 19 May 2021 14:22:18 -0700 >>> Subject: [PATCH] mm: page_alloc: dump migrate-failed pages only at -E= BUSY >>> >>> 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) >>> >>> 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 view. >>> >> >> what about -ENOMEM when migrating empty/free huge pages? I think there= is >> value in having the pages dumped to identify something like that. And = it >> doesn=E2=80=98t require heavy memory pressure to fail allocating a hug= e page. >> >=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? You would spot a huge page in the source list (usually at first=20 position) without any obvious migration blockers I assume? I'm wondering, did you actually run into this being suboptimal? If it's=20 a real problem dumping too many stuff when running into -ENOMEM, fine=20 with me. If it's a theoretical issue, I'd prefer to just keep it simple=20 as is. --=20 Thanks, David / dhildenb