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 E0F00EB64DD for ; Wed, 9 Aug 2023 09:34:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DB0A6B0071; Wed, 9 Aug 2023 05:34:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48A966B0074; Wed, 9 Aug 2023 05:34:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 351ED8E0001; Wed, 9 Aug 2023 05:34:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 272CB6B0071 for ; Wed, 9 Aug 2023 05:34:57 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E5CFB1A08A9 for ; Wed, 9 Aug 2023 09:34:56 +0000 (UTC) X-FDA: 81104056992.15.E97D91A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 9F4F040007 for ; Wed, 9 Aug 2023 09:34:54 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eO6N+atf; spf=pass (imf12.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691573694; h=from:from:sender: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:dkim-signature; bh=0JtG4J6+lRTSEQC3A+Pd+U5xijIgwHwBecuZjdnUXZw=; b=3lTyFGd0RBvJeCuPcxGZsDDIgE1AZB59m/iUyQ2Hl8u6Lttj5RkkjHXDBeJ8b8PTEmAA8L KqWpHLW+JK26eISBT74zUMV7eSQTEH+VUpVf8fYudJry0vkWO+pCNhP1L3JCFSKNhD83qB g2ovow06J3JyfgyPNWNfJP28N/G0Shs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691573694; a=rsa-sha256; cv=none; b=E421nbNR54SxplsV2uwqCyEjcBEz7ykQRY1CBcFngAdr1ZO/j3kfz9YV5TXlueMn4AE2jU MveJy9YOLx+sest6QDNdgjxNAdNBy3ehTjrekrQ6V7WoN/IJyiCxQA+BXJZaJxmGvTGbCn kD7VOL13ynx1rwBbJqIxDd1vsvbnqZE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eO6N+atf; spf=pass (imf12.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691573693; 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=0JtG4J6+lRTSEQC3A+Pd+U5xijIgwHwBecuZjdnUXZw=; b=eO6N+atfYjkAzoMO+/zTo/NLm2XcPSitkCQT8+jNuEborKdQ1yssCiqS7Qznw5Eii+2Cfj b7hQga0/2QkMQ86+8mIE/3N32x+VYjHXmyoHlrZPURxGwvjQG7AeEbp6izA3P2p32ygZoD 4FjSUONR8AN8Iio1mDpEN9UCPdGLCug= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-MjTKFaKINeSe4K03Y7TSjA-1; Wed, 09 Aug 2023 05:34:50 -0400 X-MC-Unique: MjTKFaKINeSe4K03Y7TSjA-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3fe15547164so43341565e9.0 for ; Wed, 09 Aug 2023 02:34:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691573689; x=1692178489; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0JtG4J6+lRTSEQC3A+Pd+U5xijIgwHwBecuZjdnUXZw=; b=Gkt2J2COeOOl9I+nDy9VjiK/qHEc5HAd4zQVA2HnJOpWcS1ckmj1aEJtenYpsldSZr t1FYMMVWnpUOKBeClSoZLwiWZrYAEb511w3Iqx0775Aw2Zcb4m94W8Oujw3stchCQeXJ derUui+4cT6as+f7eysifBoyXYkGcUJOdw2EaQbLp7I3kHxPDKx/3p1ljQfCc7uuBGpf 27RT2MMBzs9tKNAPAe9w0VyVXJDuYfwR8+3m3GcGW6lvJP9bQLxzYx4vdstXLI1JhJXD /C8CoKRGf4HpVeq4T+6oZa8W2X/Clm25cKlbXQTrEBPWobvf1QHM5fUjmIXY6Ibg4pfZ t9vg== X-Gm-Message-State: AOJu0YyV7M/31uvURl5yL57h2GgtCd8gZ2JLW4yYF0OyDaSCO1FYjLls mgRzVcvYvdGQ8jyKcyzDvOJGYJk1AfEkflY9J9WhMaX1eVXor2FvWPe0KfOuIZ6dQGQxzLR7Gy3 Iz5FHi9S2+bA= X-Received: by 2002:a05:600c:c9:b0:3fe:16d3:7d60 with SMTP id u9-20020a05600c00c900b003fe16d37d60mr1808912wmm.9.1691573689459; Wed, 09 Aug 2023 02:34:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhPABlpDEqKi+P2kgBh6go8teLqjfdccEJMM92NETDnOEqRX5VAuO3iNfORqErTyajdAxBLQ== X-Received: by 2002:a05:600c:c9:b0:3fe:16d3:7d60 with SMTP id u9-20020a05600c00c900b003fe16d37d60mr1808885wmm.9.1691573688979; Wed, 09 Aug 2023 02:34:48 -0700 (PDT) Received: from ?IPV6:2003:cb:c70e:6800:9933:28db:f83a:ef5? (p200300cbc70e6800993328dbf83a0ef5.dip0.t-ipconnect.de. [2003:cb:c70e:6800:9933:28db:f83a:ef5]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003fe2b6d64c8sm1438677wmc.21.2023.08.09.02.34.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Aug 2023 02:34:48 -0700 (PDT) Message-ID: Date: Wed, 9 Aug 2023 11:34:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Alistair Popple , Ryan Roberts Cc: Andrew Morton , linux-mm@kvack.org, mhocko@suse.com, jhubbard@nvidia.com, ying.huang@intel.com, osalvador@suse.de, baolin.wang@linux.alibaba.com, ziy@nvidia.com, shy828301@gmail.com References: <20230807063945.911582-1-apopple@nvidia.com> <20230807063945.911582-2-apopple@nvidia.com> <9de42ace-dab1-5f60-af8a-26045ada27b9@arm.com> <87leen2f4y.fsf@nvdebian.thelocal> <460ae27d-987f-ec45-9d37-1566f7c4f576@arm.com> <87fs4sal9n.fsf@nvdebian.thelocal> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 2/2] selftests/migration: Disable NUMA balancing and check migration status In-Reply-To: <87fs4sal9n.fsf@nvdebian.thelocal> 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-St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We4OvaxaU9+2v6421 hcCKGdK+ zYywUGMNkgJLxz9cUpm0garHPP5xjWlYiflw97jYCS7p1ClNmUgwubQDSBERPaPnu/5dqQVI73qe3LTdOzu6fZZ1Zqf/QPuvz2c3dIV0WCgSDJ9bt+PAyaqqcDV8i+nrombWpnY18MkBQFnnEhv138tkROc1xGOFRiMOAl/wS9tc9KJICnkBfJxk8fKyw330/Ag5dkaP35d0TIrHoiR4yLXpn0QdeBwTRhCWge8u00dqRA9WVTHJ4RPB4j/zty/n/cHofiVMz/fkvpeyRq4ngzZQ190Y7F5nF8ZMs5d0ZiRBU/g/obiPkUdlfm+yOthsG4sz0rLyRjZM7RfLViiReWQucCStkqA70k4wVU7L2sA44Uz7P7UWErnZEsbJ9PRSwhZc0XDJQBobGE8+F+wzOj25+mzjcLKrq3cSSvYcHBFnBor7knEcE0r9HhijqBZR0onXZ42p7D82K/00THQUBwm+hEi3jcUGo8V0FTFjg7rl1eso= 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 09.08.23 06:21, Alistair Popple wrote: > > Ryan Roberts writes: > >> On 07/08/2023 13:41, Alistair Popple wrote: >>> >>> Ryan Roberts writes: >>> >>>> On 07/08/2023 07:39, Alistair Popple wrote: >>>>> The migration selftest was only checking the return code and not the >>>>> status array for migration success/failure. Update the test to check >>>>> both. This uncovered a bug in the return code handling of >>>>> do_pages_move(). >>>>> >>>>> Also disable NUMA balancing as that can lead to unexpected migration >>>>> failures. >>>>> >>>>> Signed-off-by: Alistair Popple >>>>> Suggested-by: Ryan Roberts >>>>> --- >>>>> >>>>> Ryan, this will still cause the test to fail if a migration failed. I >>>>> was unable to reproduce a migration failure for any cases on my system >>>>> once I disabled NUMA balancing though so I'd be curious if you are >>>>> still seeing failures with this patch applied. AFAIK there shouldn't >>>>> be anything else that would be causing migration failure so would like >>>>> to know what is causing failures. Thanks! >>>> >>>> >>>> Hi Alistair, >>>> >>>> Afraid I'm still seeing unmigrated pages when running with these 2 patches: >>>> >>>> >>>> # RUN migration.shared_anon ... >>>> Didn't migrate 1 pages >>>> # migration.c:183:shared_anon:Expected migrate(ptr, self->n1, self->n2) (-2) == 0 (0) >>>> # shared_anon: Test terminated by assertion >>>> # FAIL migration.shared_anon >>>> not ok 2 migration.shared_anon >>>> >>>> >>>> I added some instrumentation; it usually fails on the second time >>>> through the loop in migrate() but I've also seen it fail the first >>>> time. Never seen it get though 2 iterations successfully though. >>> >>> Interesting. I guess migration failure is always possible for various >>> reasons so I will update the test to report the number of failed >>> migrations rather than making it a test failure. >> >> I find it odd that migration always succeeds for the private_anon and >> private_anon_thp cases, but fails for the fork case. I guess there is something >> about the page being RO (for CoW) or having higher mapcount/refcount that causes >> the migration to fail? > > But the fork case uses a shared mapping, so there shouldn't be any > RO/CoW AFAIK. A higher refcount than expected would cause migration > failure, but there's nothing I can think of that would be causing that > now NUMA balancing is disabled in the test (that caused migration > failures for me in the private cases due to the concurrent migration > attempts). Yes, we do have MAP_SHARED | MAP_ANONYMOUS, which is just shmem with extra-steps. In add_page_for_migration(), we do have if (page_mapcount(page) > 1 && !migrate_all) but the test seems to always specify MPOL_MF_MOVE_ALL when calling move_pages(), so it should be ignored. It would be helpful to dump the page when migration fails in that case. Note that in add_page_for_migration(), we perform a follow_page() that used to accidentally honor NUMA hinting faults. Fixed by commit 3c471b04db7604974e3bea45e2d9c7c27a905536 Author: David Hildenbrand Date: Thu Aug 3 16:32:02 2023 +0200 mm/gup: reintroduce FOLL_NUMA as FOLL_HONOR_NUMA_FAULT in mm-unstable. Maybe that fix does no longer require you to disable NUMA hinting for this test case. Maybe you're lucky and it resolves the shared_anon case as well, but I somewhat doubt it :) It doesn't really explain why the shared case would fail, though... -- Cheers, David / dhildenb