Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2108743rdd; Thu, 11 Jan 2024 22:16:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0fiiGhhJ3eje97M1rPwVgXc5OtxtPPNpgBGIVITXXbKwiV78vFe3zxm3kQ7/aGCCWOCGs X-Received: by 2002:a05:6402:22c1:b0:558:b5c0:45eb with SMTP id dm1-20020a05640222c100b00558b5c045ebmr1278701edb.5.1705040203258; Thu, 11 Jan 2024 22:16:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705040203; cv=none; d=google.com; s=arc-20160816; b=K9ysehYQQrY/+h1brWJftGhDKojr4KafQxf2GYW14wr2tuOAUQgdC6pChJe3d+Yn+r AH2J8DLqsuM1i+mkxUH4t/u2mXtm8LXvGx0X+Xc0gyV/NU0dOujOijzovRtKP31Vzn8X pGnQ6vfYheXPOi7OuRKdMHZRZgvgDfl3iBNcJt3Obpgk4AjIgMsi6ihhbFV9WsBYdM9M ZVDde0oIUz5PTgfhr1pmNXn0YdGRseofQiTN4Zhho+tDnMxY8IJfRkq6DIFOTkStBXIl 0zH2O/Uy2vRXC6T7oYlu7SdaSHLYGtAxazj2NQ3gmaLq1gQUDg5bVNVLWM7cSZNhjV9Z fdUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=wH7GNgz3oAqqQIQ1YMQhFQGSC42+CAjS/Ur24WT0Ito=; fh=BCopzrxnM9AHq8PUVQwJQsEpm64NyPMYmpAXBU9uP+I=; b=pc/WNg4x3j+XESTkDIkQqeuJ3/YKLVmLElK6Xp04ZhqxI/Ppwku/E9nW1elHrvnA59 UUiO0tldR+yEfmCUu5V8sILReA0L/ARZEplrhlVQJmX3Xfqd4dRjPlClqaEjcgKxmbyS DEeZuvFEwMQ9cPZ07j3iZtdM+pqKch5kXMEx1iECu/DaWD2XfrZe5MRs/jHX1+tOZpIr g8WszxpAOv8bD3d+zA0RqKe0gKgxa5w9d6iSokGWJ41/sjNCPsLJAtutaoewhXbQD/P0 l7zkVVzKZ3K4cYJAvrPqIi69trAGy/3f+tPxrwkKBw7PAKSj25pxEcXUiNIcgKdoG/nN SQpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=5QK0yV41; spf=pass (google.com: domain of linux-kernel+bounces-24334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id es5-20020a056402380500b0055860105da8si1166681edb.54.2024.01.11.22.16.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 22:16:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=5QK0yV41; spf=pass (google.com: domain of linux-kernel+bounces-24334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 00CB91F25BCC for ; Fri, 12 Jan 2024 06:16:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D63FC5C8EA; Fri, 12 Jan 2024 06:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="5QK0yV41" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84CF65C8E1 for ; Fri, 12 Jan 2024 06:16:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705040191; bh=r92f2aG9W1o5RGaWeOcmFA+zp/Tat8uerpfmCdUCBJs=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=5QK0yV4166uJ+Fb1SPpMaesp9BvEfqbwcqkcRfUEtfeSO4+xtzxIOG96soOBQcyJe k3Exs5xwA67KBbM4daBw2nMBlT8YVMMCLWutZR3D6YjjGKO4A+9GAyGc1hIW0/nNVf MNXZq+Z2Kz3ziUh9p7WXjrUQ44WQDqAxGy46rzZnYaz2azZy1hoX3O/sp4TPuM4mDZ bYurIdwdabygRHPKFNQDqfdq51FzJyp9Gj06ObkhypyvJO+ldGjV1IiEaXdEMyB0B0 Vy0NWNXMhCkzDZUL94TUoINlCq3H9c2N4fYoLsXs+OVjF4cDnEHOBuUKHLbZ8mdtH9 7x6ZMNuLM8p6w== Received: from [100.96.234.34] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 70F6D3781FE5; Fri, 12 Jan 2024 06:16:26 +0000 (UTC) Message-ID: <772a2c59-7616-4ec7-9050-17d3abf0b6eb@collabora.com> Date: Fri, 12 Jan 2024 11:16:32 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , linmiaohe@huawei.com, mike.kravetz@oracle.com, naoya.horiguchi@nec.com, akpm@linux-foundation.org, songmuchun@bytedance.com, shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jthoughton@google.com, "kernel@collabora.com" , "Matthew Wilcox (Oracle)" , Linux Regressions Subject: Re: [PATCH v4 4/4] selftests/mm: add tests for HWPOISON hugetlbfs read Content-Language: en-US To: Jiaqi Yan , Sidhartha Kumar References: <20230713001833.3778937-1-jiaqiyan@google.com> <20230713001833.3778937-5-jiaqiyan@google.com> <079335ab-190f-41f7-b832-6ffe7528fd8b@collabora.com> From: Muhammad Usama Anjum In-Reply-To: <079335ab-190f-41f7-b832-6ffe7528fd8b@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/10/24 3:15 PM, Muhammad Usama Anjum wrote: > On 1/10/24 11:49 AM, Muhammad Usama Anjum wrote: >> On 1/6/24 2:13 AM, Jiaqi Yan wrote: >>> On Thu, Jan 4, 2024 at 10:27 PM Muhammad Usama Anjum >>> wrote: >>>> >>>> Hi, >>>> >>>> I'm trying to convert this test to TAP as I think the failures sometimes go >>>> unnoticed on CI systems if we only depend on the return value of the >>>> application. I've enabled the following configurations which aren't already >>>> present in tools/testing/selftests/mm/config: >>>> CONFIG_MEMORY_FAILURE=y >>>> CONFIG_HWPOISON_INJECT=m >>>> >>>> I'll send a patch to add these configs later. Right now I'm trying to >>>> investigate the failure when we are trying to inject the poison page by >>>> madvise(MADV_HWPOISON). I'm getting device busy every single time. The test >>>> fails as it doesn't expect any business for the hugetlb memory. I'm not >>>> sure if the poison handling code has issues or test isn't robust enough. >>>> >>>> ./hugetlb-read-hwpoison >>>> Write/read chunk size=0x800 >>>> ... HugeTLB read regression test... >>>> ... ... expect to read 0x200000 bytes of data in total >>>> ... ... actually read 0x200000 bytes of data in total >>>> ... HugeTLB read regression test...TEST_PASSED >>>> ... HugeTLB read HWPOISON test... >>>> [ 9.280854] Injecting memory failure for pfn 0x102f01 at process virtual >>>> address 0x7f28ec101000 >>>> [ 9.282029] Memory failure: 0x102f01: huge page still referenced by 511 >>>> users >>>> [ 9.282987] Memory failure: 0x102f01: recovery action for huge page: Failed >>>> ... !!! MADV_HWPOISON failed: Device or resource busy >>>> ... HugeTLB read HWPOISON test...TEST_FAILED >>>> >>>> I'm testing on v6.7-rc8. Not sure if this was working previously or not. >>> >>> Thanks for reporting this, Usama! >>> >>> I am also able to repro MADV_HWPOISON failure at "501a06fe8e4c >>> (akpm/mm-stable, mm-stable) zswap: memcontrol: implement zswap >>> writeback disabling." >>> >>> Then I checked out the earliest commit "ba91e7e5d15a (HEAD -> Base) >>> selftests/mm: add tests for HWPOISON hugetlbfs read". The >>> MADV_HWPOISON injection works and and the test passes: >>> >>> ... HugeTLB read HWPOISON test... >>> ... ... expect to read 0x101000 bytes of data in total >>> ... !!! read failed: Input/output error >>> ... ... actually read 0x101000 bytes of data in total >>> ... HugeTLB read HWPOISON test...TEST_PASSED >>> ... HugeTLB seek then read HWPOISON test... >>> ... ... init val=4 with offset=0x102000 >>> ... ... expect to read 0xfe000 bytes of data in total >>> ... ... actually read 0xfe000 bytes of data in total >>> ... HugeTLB seek then read HWPOISON test...TEST_PASSED >>> ... >>> >>> [ 2109.209225] Injecting memory failure for pfn 0x3190d01 at process >>> virtual address 0x7f75e3101000 >>> [ 2109.209438] Memory failure: 0x3190d01: recovery action for huge >>> page: Recovered >>> ... >>> >>> I think something in between broken MADV_HWPOISON on hugetlbfs, and we >>> should be able to figure it out via bisection (and of course by >>> reading delta commits between them, probably related to page >>> refcount). >> Thank you for this information. >> >>> >>> That being said, I will be on vacation from tomorrow until the end of >>> next week. So I will get back to this after next weekend. Meanwhile if >>> you want to go ahead and bisect the problematic commit, that will be >>> very much appreciated. >> I'll try to bisect and post here if I find something. > Found the culprit commit by bisection: > > a08c7193e4f18dc8508f2d07d0de2c5b94cb39a3 > mm/filemap: remove hugetlb special casing in filemap.c #regzbot title: hugetlbfs hwpoison handling #regzbot introduced: a08c7193e4f1 #regzbot monitor: https://lore.kernel.org/all/20240111191655.295530-1-sidhartha.kumar@oracle.com > > hugetlb-read-hwpoison started failing from this patch. I've added the > author of this patch to this bug report. > >> >>> >>> Thanks, >>> Jiaqi >>> >>> >>>> >>>> Regards, >>>> Usama >>>> > -- BR, Muhammad Usama Anjum