Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp270905img; Mon, 18 Mar 2019 02:46:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBsTo9LhGqmPr11DAD0synkMBdq+S4m320gExUiNQ741BsPox7l98931CTWkD7o4ADc+Pg X-Received: by 2002:a17:902:8693:: with SMTP id g19mr18954230plo.157.1552902375247; Mon, 18 Mar 2019 02:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552902375; cv=none; d=google.com; s=arc-20160816; b=ikAGZOk1QJMcs2oQHEBHnppefqOhBQr/V2EL3DBqGEiEQSbQ79ie0Sjw4wao3kuxB1 AqXBHPDfpEhdZmKbWFHcsbRBTcP8yDpwvgulOha8zpV5TeZiQbBfAToq1zLnAfyJVk0b kToZCJv0SHQUur4pOtmDeoxzXU8B+3L9ctujb2drQILoZKRgOkh9HjtiNmVP6LCs8nNs EeHJkvRlUcY48j0zT66vydHQJMvMfGUOnuXg7b3vhfsdc0S7tizJEH8VpQ0moOQrkPni SYDvjocb1whGjyg6q1sIM51OyaZz0O+B/QphYad+u+uMyCH9MF+YpLmChpemDT3JDsVf 7hkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ss40qxssAzeLfjniYWHdZ3YlnDvKPb82SQ6i59HBzFI=; b=UxTwgzRbBMWAOAG4qbCmdgbwNrx9Xa/BVqTSEUSaCYKWIG21X2Y6COzIWs8nikoYxz wP1JLOGOVoFsvbMKaODpCqFxQ04L3QER2DbnpBpTBJODQ86mB8Y27DIuFQjA3Nx3zTjy 2c//T6Y70WICOHIDD+PfMPcpCUVcphrR1wHSWZVE5nR8DUCVgZe1T5vdOnn01E6dGItW mN9nWuz82XCvTYWUcjXMwWVFZM2JXnPW+vstyE9g+9cWl0813Yn6jY/KmejK0YMeTd8Q i9S0gBKNuWAVYkLxL5v+N4PD+6IPfdM48oxg62TVVtzliRSReix+lMmVHfXQFGS9R7aw PyCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ps1BlF4N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si8285957pgu.224.2019.03.18.02.45.59; Mon, 18 Mar 2019 02:46:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ps1BlF4N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728637AbfCRJbu (ORCPT + 99 others); Mon, 18 Mar 2019 05:31:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:39652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727896AbfCRJbs (ORCPT ); Mon, 18 Mar 2019 05:31:48 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F405E2083D; Mon, 18 Mar 2019 09:31:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552901507; bh=opGQAHE+OdsYRrNylD4oRsqc4EsomVR/Y7YO9dzfPE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ps1BlF4NI4D0L1O/jlwQ3SkePKUQxJKFGyqILdIEaSvhNDX3pATA7fvNnXxkHblJ+ JgVEC5NC75Jmz2bDJ1vetxiGOLeBYgY1vTQdYrLfA6rkOnq1SD7s0vamrNY/lR8oAo vW0Nmg7T/ghjZ6CXhdnEWUnHhiLosXU3OeJ2s7qM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Marc Dionne , "David S. Miller" Subject: [PATCH 4.19 15/52] rxrpc: Fix client call queueing, waiting for channel Date: Mon, 18 Mar 2019 10:25:12 +0100 Message-Id: <20190318084015.354651851@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190318084013.532280682@linuxfoundation.org> References: <20190318084013.532280682@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells [ Upstream commit 69ffaebb90369ce08657b5aea4896777b9d6e8fc ] rxrpc_get_client_conn() adds a new call to the front of the waiting_calls queue if the connection it's going to use already exists. This is bad as it allows calls to get starved out. Fix this by adding to the tail instead. Also change the other enqueue point in the same function to put it on the front (ie. when we have a new connection). This makes the point that in the case of a new connection the new call goes at the front (though it doesn't actually matter since the queue should be unoccupied). Fixes: 45025bceef17 ("rxrpc: Improve management and caching of client connection objects") Signed-off-by: David Howells Reviewed-by: Marc Dionne Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/rxrpc/conn_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -353,7 +353,7 @@ static int rxrpc_get_client_conn(struct * normally have to take channel_lock but we do this before anyone else * can see the connection. */ - list_add_tail(&call->chan_wait_link, &candidate->waiting_calls); + list_add(&call->chan_wait_link, &candidate->waiting_calls); if (cp->exclusive) { call->conn = candidate; @@ -432,7 +432,7 @@ found_extant_conn: call->conn = conn; call->security_ix = conn->security_ix; call->service_id = conn->service_id; - list_add(&call->chan_wait_link, &conn->waiting_calls); + list_add_tail(&call->chan_wait_link, &conn->waiting_calls); spin_unlock(&conn->channel_lock); _leave(" = 0 [extant %d]", conn->debug_id); return 0;