From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-101.mta0.migadu.com [91.218.175.101]) (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 DA1964195D2 for ; Mon, 24 Aug 2026 12:44:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787575469; cv=none; b=QMQ4dhl51vT1UxCj1miHH//kWL9Dibl9Hlh4u7XQ7MjOsmRc3Hh9uUBvoHyYJRComsDK5mq4BSsmO243U7dzpJe+7WZ1RATf0C/B2zmno595FfDaqAUhkZxhwIVL6wqqO7MmI3k9Ds+teG/Bjq7FJ4kedNbdwoLxq3v+EhiAhAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787575469; c=relaxed/simple; bh=vT3O2EFG7/yjVwFg0uSlFnkUl6zDMUcxN7qLIgRmen4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u9Mzx5ZgHyf2/+uM2TxbsqmdbvrmU9S1mfPH4CMGkePUX1yWqQdegUW5tYEVS7HKa9yBp3M6eNwb2lrWEyNaKKiATHEBtgrZC7eO71EiYHnEXzmCmgJGObX8+s4nCNgvmCtKHmIeihU67T1u+E/qdBosl+2anIFOjNBOhvJrgRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=O+tkFzfn; arc=none smtp.client-ip=91.218.175.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="O+tkFzfn" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=vT3O2EFG7/yjVwFg0uSlFnkUl6zDMUcxN7qLIgRmen4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787575465; v=1; x=1788180265; b=O+tkFzfny4HA/lFv8f/P24sIDt3lMhVGFYRdiF20ls1wpgrPzAfrd8gPa7sPcCMUBUpYuDuF 4LVgAp0vxLbHwFVN2z1XCGTbc6QlvOvb7/ELyUm9OHxHcTGlATzTW0D5M+8FFQjLtQYGpciY4Hm rEaFnCVE9AzZps8ghRgaiAkw= X-Envelope-To: linux-kernel@vger.kernel.org Received: from [10.54.25.56] (222.72.143.228) by smtp.migadu.com with ESMTPS id 773f15d935439da7; Mon, 24 Aug 2026 12:44:25 +0000 X-Mizu-Trace-ID: 773f15d935439da7 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Mon, 24 Aug 2026 20:44:18 +0800 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 bpf-next v4 1/4] bpf: Add a sleepable page allocator for map memory To: Michal Hocko Cc: bpf@vger.kernel.org, Emil Tsalapatis , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Ihor Solodrai , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev References: <20260821050250.35112-1-jiayuan.chen@linux.dev> <20260821050631.39784-1-jiayuan.chen@linux.dev> From: Jiayuan Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/24/26 8:26 PM, Michal Hocko wrote: > On Fri 21-08-26 13:06:12, Jiayuan Chen wrote: >> bpf_map_alloc_pages() picks the allocator via can_alloc_pages(), a >> conservative guess for BPF program context that is always false under >> PREEMPT_RT. So even a caller that really is sleepable gets the >> non-blocking allocator, which never reclaims and never engages the OOM >> machinery. > I thought one of the main motivations was reentrancy. As you cannot > really assume the context bpf_map_alloc_pages is called from there is an > extra care needed so that this doesn't re-enter the allocator from bpf > program called from allocator path and deadlock. Agreed, bpf_map_alloc_pages() is designed to be safe to run in any context. The commit message should be precise.