From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 E3AD6301463 for ; Mon, 25 Aug 2025 17:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756141214; cv=none; b=IZiGfGF/0iGgaGngo4b7OrTvaC23+b/y0S5nqsWOAvAbBDgMEDjGEgvOj2CVQUFQDP+/x04gaq7KHb7LZSTL+CHPqWo+DhSnTv8dmylXcl6gUiqOaj3ekw2qeKt1V/CGHo1FxNJ3phg8fZoxAtw2m8EKvH9yiQkxGzw0u1tOCTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756141214; c=relaxed/simple; bh=ggWL8GPworOcyT85eNMo8lBrOLG6QsXHTYPtaF7L9O0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=YQU3ghQ2Utt4spnF65HWgmZYo1+lEAHhV5UpQjnDUjEOHQa0iC0deGidzNyQj8PjUtwi8y2N8gyKELFR3w/JWiEiWI2F0qxL1EU+66smmvtVLig93Ow0+/AxUPlUD/70h1xBJX4OXk88qvAjREkSR1+ViSjSFDZXO38EvtDLxQw= 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=ZUra9uhh; arc=none smtp.client-ip=95.215.58.177 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="ZUra9uhh" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1756141210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6uJo9FbTXrzowr8bEe61nZYQy1ZZH3tikDVmsKo+eZ0=; b=ZUra9uhhuroF/AWQrMpTXqdJomo2gUtw+oC8PyZGUMqGcCITfRywK7cZOklUHO1xq4J1h7 hXSNz+75AFa0o+inHBTr9VWOSw85k4C++U7huvSKbrcCyrmD0qkCwVh3Ow/Wx6VjYnW+UI 7ASd9pZu8gDLNMnaGJN1d6iVB4yLXr8= From: Roman Gushchin To: Martin KaFai Lau Cc: Kumar Kartikeya Dwivedi , linux-mm@kvack.org, bpf@vger.kernel.org, Suren Baghdasaryan , Johannes Weiner , Michal Hocko , David Rientjes , Matt Bobrowski , Song Liu , Alexei Starovoitov , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 01/14] mm: introduce bpf struct ops for OOM handling In-Reply-To: <1f2711b1-d809-4063-804b-7b2a3c8d933e@linux.dev> (Martin KaFai Lau's message of "Fri, 22 Aug 2025 12:27:48 -0700") References: <20250818170136.209169-1-roman.gushchin@linux.dev> <20250818170136.209169-2-roman.gushchin@linux.dev> <87ms7tldwo.fsf@linux.dev> <1f2711b1-d809-4063-804b-7b2a3c8d933e@linux.dev> Date: Mon, 25 Aug 2025 10:00:02 -0700 Message-ID: <87wm6rwd4d.fsf@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT Martin KaFai Lau writes: > On 8/20/25 5:24 PM, Roman Gushchin wrote: >>> How is it decided who gets to run before the other? Is it based on >>> order of attachment (which can be non-deterministic)? >> Yeah, now it's the order of attachment. >> >>> There was a lot of discussion on something similar for tc progs, and >>> we went with specific flags that capture partial ordering constraints >>> (instead of priorities that may collide). >>> https://lore.kernel.org/all/20230719140858.13224-2-daniel@iogearbox.net >>> It would be nice if we can find a way of making this consistent. > > +1 > > The cgroup bpf prog has recently added the mprog api support also. If > the simple order of attachment is not enough and needs to have > specific ordering, we should make the bpf struct_ops support the same > mprog api instead of asking each subsystem creating its own. > > fyi, another need for struct_ops ordering is to upgrade the > BPF_PROG_TYPE_SOCK_OPS api to struct_ops for easier extension in the > future. Slide 13 in > https://drive.google.com/file/d/1wjKZth6T0llLJ_ONPAL_6Q_jbxbAjByp/view Does it mean it's better now to keep it simple in the context of oom patches with the plan to later reuse the generic struct_ops infrastructure? Honestly, I believe that the simple order of attachment should be good enough for quite a while, so I'd not over-complicate this, unless it's not fixable later. Thanks!