Message ID | 20240105155419.1939484-1-leitao@debian.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-18016-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6305658dyb; Fri, 5 Jan 2024 07:55:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IENS491X3Akxn5eUzqNBezI5bBEpgIfIcmYCeRZV9GSPcWszzv+vUzUJCAaEKM6p9OpeGts X-Received: by 2002:a05:6e02:160e:b0:360:5cd9:a73e with SMTP id t14-20020a056e02160e00b003605cd9a73emr2503764ilu.6.1704470127002; Fri, 05 Jan 2024 07:55:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470126; cv=none; d=google.com; s=arc-20160816; b=NYrFwKymzXGpQ1v0sDNcS0CTyhdqW5YvWd42uIVT+vp+D0nLoxWMsoxF5pjES6Ds7e V+GJlC/qV0pGkJ51SRPG89lSRActfYnDw+m64EYAMJgbAuCIZV3U+n1fGIcYbkGLnjuS 9i+f/nMAMyd4gL2YWfxUEcgFJqN8Ba0cS14tgBNMV5MIZ9eYy41+DrLz6roz7aXXDOYT yD0aLJjsty5TwA4XfZ/jZR7cEE4EN2zMbPslkAV9/q/lNr8ENpBeg4ofKRnNr69XLgeJ 2TinMg5mRgiAHQYKdyL/XAIWg5WJIkEsm9pg2hZaDO/OhrGEvpmE+irpX6GkMBloUAm1 f0zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=w6wG9ZzYTMIbl90MDDwci6aGriZP9ArruE6XkOlXJdQ=; fh=BI2Y9Kn2wPpdDmW1NYj0uRHsVWstvnJfPOXYvpiu8Dc=; b=fRRpJT5z3t0bY/MqB4IGGzXx/IYHYmAVCOcBz4KLps6tQxlYcTBTXVPNlYt9pRC4FM M1mph7Hyvrm/1n3ipF/HbvAC98/j+q6U9duovLfHEwdNmvzyLjJslqn8695OIh0ZV57C 6vyi1mMR+l3f8J0j3w47CpPGFOXjBNfIT64dZ5QUEFcSFXOv/REcJHk9G/ZCB5B9/+BO 2FwA2WlFIvE/fQo2O9p9wMuav1P42AbY9XPosm2prsNdpjy2Vmz3cS/7zBVK50OzSvlT l+A/qabDmMKaqq0P0vjGuWVj/US6WQ3ErXN4EqehVvWakU48nF/d8QLLj2XXnEhRjWoA VSgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-18016-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18016-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l133-20020a633e8b000000b005ce01959fbcsi1448385pga.120.2024.01.05.07.55.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 07:55:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18016-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-18016-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18016-ouuuleilei=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 00DD928327A for <ouuuleilei@gmail.com>; Fri, 5 Jan 2024 15:54:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 077572E849; Fri, 5 Jan 2024 15:54:34 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2AD22E651; Fri, 5 Jan 2024 15:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-553ba2f0c8fso1901574a12.1; Fri, 05 Jan 2024 07:54:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704470069; x=1705074869; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w6wG9ZzYTMIbl90MDDwci6aGriZP9ArruE6XkOlXJdQ=; b=gMAkMddK8k+/VuziXxyF0Fm3mxl8t1jNHc6njXt1FtlVIYdPL+BlBuVwFayM3NkYhp Ii35mkuN2gD4X+34GWF2zuJehbB4BY09ywlopQAZwU7tn0waW4YASJMBF7Xr5UDPuppQ xOKbzaVN1CczeI/BY8zY9Kgi+zmzlhkVAQcsp22LlEBXDHrqx3fiUTsle4ubHJAsHa8K cOIjNTMWolxQOCV64pRYe9BKe1wvv+UdYpKDiqyyRxnswT5w3KeIo9uJ1Qmx5z8QLK1T 59IBLytMlSCOc9P0VFNMfbVvMzkkcFulEcN3aVNNesB6Ledc3ixaetfDkJQrha6a4md/ qeEg== X-Gm-Message-State: AOJu0YwVD5jGw1O2xKu9IFwCzSgwbUGtaTJ4p1DNRS+MftmoyZFohxGP zJG9cVcWwDHMia01zIvWKt0= X-Received: by 2002:a50:c219:0:b0:557:d32:fe2 with SMTP id n25-20020a50c219000000b005570d320fe2mr506778edf.47.1704470069019; Fri, 05 Jan 2024 07:54:29 -0800 (PST) Received: from localhost (fwdproxy-cln-001.fbsv.net. [2a03:2880:31ff:1::face:b00c]) by smtp.gmail.com with ESMTPSA id 3-20020a508e03000000b0055515b40464sm1110374edw.81.2024.01.05.07.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 07:54:28 -0800 (PST) From: Breno Leitao <leitao@debian.org> To: riel@surriel.com, linux-mm@kvack.org, akpm@linux-foundation.org Cc: vegard.nossum@oracle.com, rppt@kernel.org, songmuchun@bytedance.com, shy828301@gmail.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/1] selftest/mm/hugetlb: SIGBUS on stolen page Date: Fri, 5 Jan 2024 07:54:18 -0800 Message-Id: <20240105155419.1939484-1-leitao@debian.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787266467887721404 X-GMAIL-MSGID: 1787266467887721404 |
Series |
selftest/mm/hugetlb: SIGBUS on stolen page
|
|
Message
Breno Leitao
Jan. 5, 2024, 3:54 p.m. UTC
This test case triggers a race between madvise(MADV_DONTNEED) and mmap() in a single huge page, which got stolen (while reserved). Once the only page is stolen, the memory previously mmaped (and madvise(MADV_DONTNEED) got a SIGBUS when accessed. I am not adding this test to the un_vmtests.sh scripts, since this test fails at upstream. Breno Leitao (1): selftests/mm: add a new test for madv and hugetlb mmap tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 1 + .../selftests/mm/hugetlb_madv_vs_map.c | 124 ++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 tools/testing/selftests/mm/hugetlb_madv_vs_map.c
Comments
On Fri, 5 Jan 2024 07:54:18 -0800 Breno Leitao <leitao@debian.org> wrote: > This test case triggers a race between madvise(MADV_DONTNEED) and > mmap() in a single huge page, which got stolen (while reserved). > > Once the only page is stolen, the memory previously mmaped (and > madvise(MADV_DONTNEED) got a SIGBUS when accessed. > > I am not adding this test to the un_vmtests.sh scripts, since this test > fails at upstream. Oh. Is a fix for this in the pipeline? If so, I assume that once the fix is merged, we enable this test in run_vmtests?
On Fri, Jan 05, 2024 at 08:42:38AM -0800, Andrew Morton wrote: > On Fri, 5 Jan 2024 07:54:18 -0800 Breno Leitao <leitao@debian.org> wrote: > > > This test case triggers a race between madvise(MADV_DONTNEED) and > > mmap() in a single huge page, which got stolen (while reserved). > > > > Once the only page is stolen, the memory previously mmaped (and > > madvise(MADV_DONTNEED) got a SIGBUS when accessed. > > > > I am not adding this test to the un_vmtests.sh scripts, since this test > > fails at upstream. > > Oh. Is a fix for this in the pipeline? If so, I assume that once the > fix is merged, we enable this test in run_vmtests? The fix is not ready yet. As soon as the fix lands, I will enable the test in run_vmtests.
On Fri, 2024-01-05 at 08:42 -0800, Andrew Morton wrote: > On Fri, 5 Jan 2024 07:54:18 -0800 Breno Leitao <leitao@debian.org> > wrote: > > > This test case triggers a race between madvise(MADV_DONTNEED) and > > mmap() in a single huge page, which got stolen (while reserved). > > > > Once the only page is stolen, the memory previously mmaped (and > > madvise(MADV_DONTNEED) got a SIGBUS when accessed. > > > > I am not adding this test to the un_vmtests.sh scripts, since this > > test > > fails at upstream. > > Oh. Is a fix for this in the pipeline? If so, I assume that once > the > fix is merged, we enable this test in run_vmtests? > I've got some ideas on how to fix it, and hope to get a fix to you and Mike by next week. I'll ask Mike if I run into any unexpected complications.