From mboxrd@z Thu Jan 1 00:00:00 1970 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 15ACE17B50D for ; Mon, 12 Aug 2024 12:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723466388; cv=none; b=FyDYKPNOJjRe3bIO79pP0CSL5Xe0WHRwDTqd+h3oOMvxInawvu96Yw458HFchfOuITvcRFVKF50NYRputAnd8EW85RuxOdH23846SMdhbl+c7qi6kD9IDFv0BzZzAZ4pVl8b66TTWmk6W4XKyLHcPOG1fIZ5p2+yvQeWwllpJwQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723466388; c=relaxed/simple; bh=UV4WTj9pB4Qb5LN9oHUKm2/MnkvrTQYFTeEw/zdnDFg=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=gSsBMw49i+YyFB7/NHcZMu5J8NIlQza3Fa4Yxr4wj2Lw4ZmLvNnEpgnrbkn04c7tRSrP1ydPiBTKfspDp8BVEVFd+V3A5WUyWgpV/sAfhivZ7DxtVtXh66z/QWIcOILuz6jG4pkp3EtIqYYsRpT2JkTG7YZbIScPJ5a4AeNRCTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i3/iICND; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="i3/iICND" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04FE6C32782; Mon, 12 Aug 2024 12:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723466387; bh=UV4WTj9pB4Qb5LN9oHUKm2/MnkvrTQYFTeEw/zdnDFg=; h=Subject:To:Cc:From:Date:From; b=i3/iICNDceaw60VecXdT0cdGmj//jxIgv6n5XJiqU1adzVa8ua41yYyYXtoqL3qKm eF8OCA9jLLOkfZKLxK4O1SY2buZ4A/oPv1GPhdb58go+6Aza00iqvyr/9+qrRK0R11 VpU0gtD7ULv/32qKnVW24ju+fHG3ZFdaYQpVo6vA= Subject: FAILED: patch "[PATCH] mptcp: pm: don't try to create sf if alloc failed" failed to apply to 6.10-stable tree To: matttbe@kernel.org,kuba@kernel.org,martineau@kernel.org,pabeni@redhat.com Cc: From: Date: Mon, 12 Aug 2024 14:39:44 +0200 Message-ID: <2024081244-smock-nearest-c09a@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.10.y git checkout FETCH_HEAD git cherry-pick -x cd7c957f936f8cb80d03e5152f4013aae65bd986 # git commit -s git send-email --to '' --in-reply-to '2024081244-smock-nearest-c09a@gregkh' --subject-prefix 'PATCH 6.10.y' HEAD^.. Possible dependencies: cd7c957f936f ("mptcp: pm: don't try to create sf if alloc failed") c95eb32ced82 ("mptcp: pm: reduce indentation blocks") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From cd7c957f936f8cb80d03e5152f4013aae65bd986 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Wed, 31 Jul 2024 13:05:56 +0200 Subject: [PATCH] mptcp: pm: don't try to create sf if alloc failed It sounds better to avoid wasting cycles and / or put extreme memory pressure on the system by trying to create new subflows if it was not possible to add a new item in the announce list. While at it, a warning is now printed if the entry was already in the list as it should not happen with the in-kernel path-manager. With this PM, mptcp_pm_alloc_anno_list() should only fail in case of memory pressure. Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink") Cc: stable@vger.kernel.org Suggested-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20240731-upstream-net-20240731-mptcp-endp-subflow-signal-v1-4-c8a9b036493b@kernel.org Signed-off-by: Jakub Kicinski diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 780f4cca165c..2be7af377cda 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -348,7 +348,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, add_entry = mptcp_lookup_anno_list_by_saddr(msk, addr); if (add_entry) { - if (mptcp_pm_is_kernel(msk)) + if (WARN_ON_ONCE(mptcp_pm_is_kernel(msk))) return false; sk_reset_timer(sk, &add_entry->add_timer, @@ -555,8 +555,6 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) /* check first for announce */ if (msk->pm.add_addr_signaled < add_addr_signal_max) { - local = select_signal_address(pernet, msk); - /* due to racing events on both ends we can reach here while * previous add address is still running: if we invoke now * mptcp_pm_announce_addr(), that will fail and the @@ -567,11 +565,15 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) if (msk->pm.addr_signal & BIT(MPTCP_ADD_ADDR_SIGNAL)) return; + local = select_signal_address(pernet, msk); if (!local) goto subflow; + /* If the alloc fails, we are on memory pressure, not worth + * continuing, and trying to create subflows. + */ if (!mptcp_pm_alloc_anno_list(msk, &local->addr)) - goto subflow; + return; __clear_bit(local->addr.id, msk->pm.id_avail_bitmap); msk->pm.add_addr_signaled++;