Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp773673rdd; Tue, 9 Jan 2024 21:47:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxCNQvCIbLeaJ6L9E9RT4KaMggDQly76CwoTEEnJ+CzBN4E4d1faxTWe5UXTuWLBkdbJZm X-Received: by 2002:a05:6a20:914a:b0:19a:24d3:b2e3 with SMTP id x10-20020a056a20914a00b0019a24d3b2e3mr519288pzc.16.1704865662341; Tue, 09 Jan 2024 21:47:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704865662; cv=none; d=google.com; s=arc-20160816; b=J0NhywuXoUTvKrsULXq5oVhu5icbiaLYH19ucoh9MAjdPh22wyaLcMeKYm2d6wayo/ XluxEjJUbFe6qRPIWEkHhGItiS/hsGy2lqlf3hKqjCcDPDK7en9hLJ2RdlTSL2mbe//A oYM+wFzttxLHWg4JmH+PrHXNHrsBLj7LKtcHgj7QZpzN6B/R5st73ornQ0GSbvqVsaLu tVZeMP2TngLs208tbxoWRNm1r4KZws2QHYxObcz8ngcijrmO/Vjg4WtMkjCOKh8nJxWK PInBneJcr8eBxKu7FLgSmu/VGxzC9ufm1GDvmV3EfctI4E9I+nBK7c9Q+AOfk6YIcdLA kQyw== 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:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=XCK4v6JK0i/4sqhJupMnURx9i5G/ZjPcARO7u5WCdvU=; fh=SOeUu0/ZalAdbn0TkjkkLI90lvBPFzHMlzQn76UsF2A=; b=OXu2Mh99i8iKSFb9ZnIfZsZXjNAFfQxR6xOa6pZfG8jVecjVboQjc40ftux9ZmcokR AfMd74EGoKdXTpL9a5xFJg5AivX2dpM3XbMDU1X+82Dg4vBB7xNk3C8PvMOxP3WuaX0G XGiTXghSJhwis9bEXgxH5+ZxJeAvfEtZgXnDb/fvYk7j4n8Se/iWXSQMT+r02xFcy5Pb UKlu60txgMF6OXGhOTx6hQ5kdXcPK4YgVVx+hrx12TRNAKSmlFGTYcCjTiaJEgbrhnP9 K+0CaJJDQy9raUGmIfz3Yvwsd+NvK1DD2yvuRu0ABY+ektPPX+YEaODWjO7FmXSxJ+Ln Ed4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=eP4fmrHe; spf=pass (google.com: domain of linux-kernel+bounces-21732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21732-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p17-20020a637411000000b00563de199314si2972871pgc.896.2024.01.09.21.47.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 21:47:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21732-linux.lists.archive=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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=eP4fmrHe; spf=pass (google.com: domain of linux-kernel+bounces-21732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21732-linux.lists.archive=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 7121C2894AB for ; Wed, 10 Jan 2024 05:47:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26DD2DF5C; Wed, 10 Jan 2024 05:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="eP4fmrHe" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 41DCEDDD1; Wed, 10 Jan 2024 05:47:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DDAC433C7; Wed, 10 Jan 2024 05:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1704865652; bh=u+YhZyGDNOdxdSwFJegLKK032t1WLWGChzSAS8V2a3k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eP4fmrHeRepHJ0pA0bpACG1sSKddJlzxQYKGjO2sPLYRp2GO/6aI2gyHnltcbzz/w f1YKgHF8aG4zSjc384gmDeq8DWygduXo3UGRiJ/1yTYQPnAtOEyf+XSAQb00X8YNHv KosuDzJzDhq4TYM2bYt5FAi1UuatWoGJTk43veDc= Date: Tue, 9 Jan 2024 21:47:31 -0800 From: Andrew Morton To: Breno Leitao Cc: riel@surriel.com, linux-mm@kvack.org, Shuah Khan , vegard.nossum@oracle.com, rppt@kernel.org, songmuchun@bytedance.com, shy828301@gmail.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] selftests/mm: new test that steals pages Message-Id: <20240109214731.a7694ae4a575be838b40e9ea@linux-foundation.org> In-Reply-To: <20240105155419.1939484-2-leitao@debian.org> References: <20240105155419.1939484-1-leitao@debian.org> <20240105155419.1939484-2-leitao@debian.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 5 Jan 2024 07:54:19 -0800 Breno Leitao wrote: > This test stresses the race between of madvise(DONTNEED), a page fault > and a parallel huge page mmap, which should fail due to lack of > available page available for mapping. > > This test case must run on a system with one and only one huge page > available. > > # echo 1 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages Can't the test framework perform this configuration prior to running the test? > During setup, the test allocates the only available page, and starts > three threads: > > - thread 1: > * madvise(MADV_DONTNEED) on the allocated huge page > - thread 2: > * Write to the allocated huge page > - thread 3: > * Tries to allocated (steal) an extra huge page (which is not > available) > > thread 3 should never succeed in the allocation, since the only huge > page was never unmapped, and should be reserved. > > Touching the old page after thread3 allocation will raise a SIGBUS. > It's a bit strange to merge a selftest which is expected to fail because of a known but unfixed kernel bug. But I'll toss the test in there anyway, as we deserve to get bug reports ;)