From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 74F8A3E6DE3 for ; Tue, 2 Jun 2026 13:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780407027; cv=none; b=CpYYEKWT3Yxg/uclnFTyDNvDpm2vKN+EEG9+tV4Ah7UWaJBmBrK4NrbNKrtYmoIk2sqgy2C80hZWSOfrVn5IAFZOTw4h47LO2Q2KTjkT7ADutQoiKC5l9lBYCpiGq3zuZNvJfkOSZ/OCuTHaDiMOPWxPj83zDF+zbQHXkIuZrCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780407027; c=relaxed/simple; bh=SitCQ9zThQAtGcEa+tRdZdKq/jWeXPhLMXixdM3Cywg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VMzbAIkKYWfsQ+V6p67xLoQ+sOa8K0azSCkPH7Fszs65sbqa5iuiqGft88q+ks5bLxK7vyVwrQCNdE7moE0kcjfqrnPox/DDEYMCU1ZN7DMBGBt8pqu3zz8ESMHg4PwmLEe5z74Hkv9grc8gYTJxjOpzu8z0+yPk/Z6XKD7EOQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OHKROyBb; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OHKROyBb" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-490a7629380so25418285e9.0 for ; Tue, 02 Jun 2026 06:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780407025; x=1781011825; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=px5683SUlyJ1WXtEe80xKFeQYckWTBD6LaRrb178pOo=; b=OHKROyBbgILPzC2Tk226dblWCwlfF4n0L2+taVutUo/TYOT7Non6/k2xHRq0e+pGBv aUEUlLlDKQzWwec7+OUyb3cJzDUh9QCQeaE2hPnk7/VZP3XZ86yhz/tAvXvCYAAaHDSD EYp0G3CJIrJopITGi3iT61Berozi8VsOxteBMiyPm84dOpO6n+HU9r9esz9LHcQF3s27 ic9l0UhN0CGddz3CS0HYgRRZYAsD+1p0yZ1KYCUbpBR6j1vdvYrMgL4zHUjhenoklovz VOTJi0BuU9mTzM9qyw+S7jtzYsbRhsmX0F1cvzvUjgecJlxwRqfIpPos0LjfQSzXlMkQ UgMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780407025; x=1781011825; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=px5683SUlyJ1WXtEe80xKFeQYckWTBD6LaRrb178pOo=; b=CNfI90tu8q7ERlLmjAyN33fW2f0OyW8lN67Wmb79+ps7nqV1FTLAa+6WgIkmmF88A6 tb5KG3cNs7kqO64KeZdbWGswOkmFiDp0t94uW2s9OywOOEfYEHqiHtOrHjcKZVvtpT4V +mGrEliSlUx/Vy9nAekHnbaJz6R6JfZZOBPXIUnjzjNpZ/0pULdze2d5JhsRDCNVBcne icskEHPg8Ddoi6KG9vV5RRHQ1kkQBJ6MRjT1CuH2QRTCSQG+b88BPNYYXtBLSnOAS9Ln +vDr5DdmSUP7FqdPEWo60hey0s1DbpRlBrdwLrdWFBrqN5GhD/VbKvyRcxOOwLmky2z0 0N8A== X-Forwarded-Encrypted: i=1; AFNElJ+S2jINSSXxggONA/1nXHPLbngz4K4G+siPZmlLoAjg+kIMFrPXsN/RdSpJogv+pZtuBoMOBgj7ufKEswc=@vger.kernel.org X-Gm-Message-State: AOJu0YxOMminnO3wfwwCse7IOoWFIaFLB3YQtgnauKI5mdq4sgtynsJx 8tVu2ygArIw/rXhBljgHexUNQN0FVb44n28VqSEfSV5IrndFowpCQF/Q X-Gm-Gg: Acq92OHSroExNoBgx8yWwnLg/9r6zl1cAAKMEFxfZ3JLCIG8RC6ArD0k4ws3HyieGmq VvRrVqNIUpRvNUBVRE6957BTXhqv+2G0XSScvyJQ40BHR1ei5TDs6IJXsLyLCfduU/rqmwFCY23 pzhDXpt3CIoX1ucKvGDqlVU0MVNQjQR18jHPNiER2dN1kjcPoFONQALPzjL1g++22p/2FfZEKKh 5n9FGi9pck8fYBqt/diLab+5NTk+9TiR1kWRe7wk0o6gcxC3ps7RWRaVURnmjQBt/2qtW6biQfi 1uEyh0lNYulLLIZ8HuYsVJqQG0a59J6V6xg1czuAez3FIz+6zChrNNOZq2osTh4CjYeIayiTm9n j6KZPa7OFIT4RMEEXgwNLo4S3QQBJGYrRnM7QbjGX6jEM+3nSwdAaJ8mAgIWWrimS7cdmj5UNdb DNckkh5U8VjHDMHWbqcyOEA0d/323gUQdzyYo96ZVoQE5NLQK1w+JNgx8udIRLxEKme1107xP0L EGG+Vmk1vuc8EhIlche8w== X-Received: by 2002:a05:600c:c108:b0:48a:7a10:4f17 with SMTP id 5b1f17b1804b1-490a290db4fmr248807115e9.6.1780407024589; Tue, 02 Jun 2026 06:30:24 -0700 (PDT) Received: from ?IPV6:2a01:4b00:bd1f:f500:f867:fc8a:5174:5755? ([2a01:4b00:bd1f:f500:f867:fc8a:5174:5755]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e0f343sm70579915e9.1.2026.06.02.06.30.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jun 2026 06:30:23 -0700 (PDT) Message-ID: Date: Tue, 2 Jun 2026 14:30:23 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests/bpf: Page out as late a possible in file_reader To: Jerome Marchand , Shung-Hsi Yu Cc: bpf@vger.kernel.org, Andrii Nakryiko , Eduard Zingerman , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , Shuah Khan , Mykyta Yatsenko , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260420134637.2513867-1-jmarchan@redhat.com> <836b0ce8-f427-434f-984b-4fc60b02c810@redhat.com> <939aae44-5901-4f2d-99c8-ad9bd5173f0f@redhat.com> Content-Language: en-US From: Mykyta Yatsenko In-Reply-To: <939aae44-5901-4f2d-99c8-ad9bd5173f0f@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/2/26 10:51 AM, Jerome Marchand wrote: > On 02/06/2026 11:26, Shung-Hsi Yu wrote: >> On Tue, Apr 21, 2026 at 07:59:08AM +0200, Jerome Marchand wrote: >>> On 4/20/26 6:52 PM, Mykyta Yatsenko wrote: >>>> On 4/20/26 2:46 PM, Jerome Marchand wrote: >>>>> The file_reader/on_open_expect_fault fails consistently on my system. >>>>> It expects a page fault on first dynptr read of some range the exe >>>>> file of the current process because it has paged out that page range >>>>> earlier. However a lot can happen to that range (which depending on >>>>> the actual memory layout could contain text section, data section, >>>>> sections )related to dynamic linking...) between the moment it was >>>>> paged out and the moment the bpf program expected to hit a pagefault >>>>> actually run. >>>>> >>>>> A bit of instrumentation with mincore() shows that pages from that >>>>> range were accessed several times before the program is run. In >>>>> particular the call of file_reader__load() seems to fault all the >>>>> range in. >>>>> >>>>> Move the call to madvise(MADV_PAGEOUT) to just before attaching the >>>>> program to minimize the risk of having those page pulled back in from >>>>> under our feet. >>>>> >>>>> Signed-off-by: Jerome Marchand >>>>> --- >>>> >>>> Thank you for the patch, the change looks good. Does it fail >>>> consistently on 4K page size? >>> >>> It did when I ran the test manually. On our automated testing system, it >>> failed intermittently. >> >> On my fork of BPF CI the test was failing[1] consistently, even when >> this commit is applied. However I wasn't able to reproduce locally on my >> laptop when I ran manually. >> >> Any hints regarding where to look and how to reproduce? > > To investigate the failure I witnessed I instrumented the test with some calls to mincore(). You can do that to see whether madvise(PAGEOUT) didn't successfully paged out those pages, or if they were paged back in by the MM subsystem. I'm afraid that this test isn't very robust: the MM subsystem is the one that ultimately decides which pages are in or out and it might not work in the way that this test assumes. > thanks for the reports, this test is indeed flaky. I'll take a look if it's possible to fix it, or we should just delete it. > Thanks, > Jerome > >> >> Thanks, >> Shung-Hsi >> >> 1: https://github.com/shunghsiyu/libbpf/actions/runs/26807198259/job/79027625188 >> >> ... >> >