Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp31318lqz; Fri, 29 Mar 2024 07:42:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVB04J66RHiqWice/ENWgzLV3bauNO/vvZCmtMNL5RtzNaI4nZeqM5LzOztv077WLGJtguSHft5DEMQbtq/M26JHI14EI10dA+LDIPrMQ== X-Google-Smtp-Source: AGHT+IGBf3/3qnp0/G5mgiPiNKiKLGB1E6R3MUC0tOuRX2gcK2zoZ1TEFD0ZNK6OHJZxNth31wKo X-Received: by 2002:a05:6402:42d4:b0:568:bfcd:e895 with SMTP id i20-20020a05640242d400b00568bfcde895mr1390511edc.41.1711723331780; Fri, 29 Mar 2024 07:42:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711723331; cv=pass; d=google.com; s=arc-20160816; b=hpGk5miyOaLeR3qpD+iNf8gGsrV0rLY6KO29rde+wOQDRSozqAlyCJ/RWBkQKQnDfL XRM1wVc3sw57/krh++PDojrR/745nLWZm90DneacXN2bicGA2NMVIz/WaghUCrRV5rkB rw9lZVh1Bb4rmcDH0SZJ/f8t9XL5oaumFBgEbf21ZVZtaJw1WkGUDaKN4Wt4CU/gk1vW 2A2tz4/8A1nvmMXB8+a9qFzLORbX27BhEvGuXbdEZZDl2ciYxVanil8RYlx1VUGsFPVx UM00U67eIDWqs41P5I005lATj1xmSB2eXnIc35YWNKbwVLRpJ/ZZHBXmnawmlVkVSasd bPWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5+onezPvF3z52pGQ2ObicpE0nU4WzViTdajXFKMX0kA=; fh=FlswFhyPBQhtF3sEYtniZ3zZwdwtobU1qnUy4ApVLwM=; b=bcQYT7CqpuFIs8idEeo6Gop8XUqve5P5rQ8NqIEYEEpOezLD0fLgpnukz1daK2/86p q8Rqjr9frj7oXoMGz02/kXvkbG8eAtA/gHktkoUkcKu6G4Rijbff+0CZXjVtBbdJ30L+ 9bzc/Qg6GXsywgxaaCl01cBH1v4IT56w01aqCHO9AFku52upxGkBTAwVxAp01sVq4XV8 NqNLwI9T24Q9hVATv4iQFVFELVlMtk1di+kudyVeK7c6PHJH5JyvC+QLkgQXGakTq2Uo LdqR7TycvWpkxs0xlvpYxMbWByzQa24Z6CrydPU7c1LtOyrDUjgLJgonCkKWK7Otn+2f Z5dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AhoM8GwP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124913-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o8-20020a509b08000000b0056b9efb2407si1899129edi.432.2024.03.29.07.42.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 07:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124913-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AhoM8GwP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124913-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8CB151F2B4A6 for ; Fri, 29 Mar 2024 14:24:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BCD92BF2F4; Fri, 29 Mar 2024 12:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AhoM8GwP" 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 A21CC2BF2E8; Fri, 29 Mar 2024 12:47:00 +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=1711716420; cv=none; b=og34sV7CcaLwFIibE/AKFMtnNy2/UsMFDgFf5yGxTMBc87Y2ovvzdwRhncxcvp98PWsrJoeaPYXuWUJbWf6tSCG0nqdcFlxZvumjlYAoH3bVZAYejrKEpSDwVAd0YN9/UFNctVa4y5sLy49NelYWdkjbyo4sPiypaucQzgn1nOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716420; c=relaxed/simple; bh=pV5mzniew1zYM9E246i2ItBSD2EbYzBdf1agjXSTLLE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AsuqZ9lMu9We5n/LUQyecHhc+L/copaHVdYXsE04CSiOPp5re9fM8lqgWi4ncsBREqv5I4UtkC4p2+gXsBYw+LACRVk6OCqOJog133yC9W/NLovQMUIx2x0zw7Hb1jYSU/VeRGWy++B7ulUy4qY6HJ1QZMUK3S/S38TATxuNiPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AhoM8GwP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 261C8C43390; Fri, 29 Mar 2024 12:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716420; bh=pV5mzniew1zYM9E246i2ItBSD2EbYzBdf1agjXSTLLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhoM8GwP6KaugxdXh/rbTq5ZuZzzMrPDL/5a32L7bV6mvhgT6PDtX0Vt3R/iEIIGJ RNMcBtLAe3+nZYEmMjaVufTKGiUyU9GX/Xk/0dsekj3oqXuQujIB44/bQTDQZiilJK 1wT2p240uQIMvm06lAnglhS66clLIVKRZhG8l5xy795tkYxFT+Mlqy5Nkng5bgKiZ0 fnMuKuOige7Aw3funtbgNerolq5tU33sDJChPO6td2Bgsz6DP8yoT9s7KqGg1qjGdK 1AgK8rDI8rJ2ryctsQAq84Ja7rT4alaDPp0Sfsp0tUOwJIU8B4rVWHgP3pQXR+eOYK 1clP21IB9yGgQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dai Ngo , Jeff Layton , Trond Myklebust , Sasha Levin , anna@kernel.org, chuck.lever@oracle.com, linux-nfs@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 29/52] SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int Date: Fri, 29 Mar 2024 08:45:23 -0400 Message-ID: <20240329124605.3091273-29-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329124605.3091273-1-sashal@kernel.org> References: <20240329124605.3091273-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.83 Content-Transfer-Encoding: 8bit From: Dai Ngo [ Upstream commit 2c35f43b5a4b9cdfaa6fdd946f5a212615dac8eb ] When the NFS client is under extreme load the rpc_wait_queue.qlen counter can be overflowed. Here is an instant of the backlog queue overflow in a real world environment shown by drgn helper: rpc_task_stats(rpc_clnt): ------------------------- rpc_clnt: 0xffff92b65d2bae00 rpc_xprt: 0xffff9275db64f000 Queue: sending[64887] pending[524] backlog[30441] binding[0] XMIT task: 0xffff925c6b1d8e98 WRITE: 750654 __dta_call_status_580: 65463 __dta_call_transmit_status_579: 1 call_reserveresult: 685189 nfs_client_init_is_complete: 1 COMMIT: 584 call_reserveresult: 573 __dta_call_status_580: 11 ACCESS: 1 __dta_call_status_580: 1 GETATTR: 10 __dta_call_status_580: 4 call_reserveresult: 6 751249 tasks for server 111.222.333.444 Total tasks: 751249 count_rpc_wait_queues(xprt): ---------------------------- **** rpc_xprt: 0xffff9275db64f000 num_reqs: 65511 wait_queue: xprt_binding[0] cnt: 0 wait_queue: xprt_binding[1] cnt: 0 wait_queue: xprt_binding[2] cnt: 0 wait_queue: xprt_binding[3] cnt: 0 rpc_wait_queue[xprt_binding].qlen: 0 maxpriority: 0 wait_queue: xprt_sending[0] cnt: 0 wait_queue: xprt_sending[1] cnt: 64887 wait_queue: xprt_sending[2] cnt: 0 wait_queue: xprt_sending[3] cnt: 0 rpc_wait_queue[xprt_sending].qlen: 64887 maxpriority: 3 wait_queue: xprt_pending[0] cnt: 524 wait_queue: xprt_pending[1] cnt: 0 wait_queue: xprt_pending[2] cnt: 0 wait_queue: xprt_pending[3] cnt: 0 rpc_wait_queue[xprt_pending].qlen: 524 maxpriority: 0 wait_queue: xprt_backlog[0] cnt: 0 wait_queue: xprt_backlog[1] cnt: 685801 wait_queue: xprt_backlog[2] cnt: 0 wait_queue: xprt_backlog[3] cnt: 0 rpc_wait_queue[xprt_backlog].qlen: 30441 maxpriority: 3 [task cnt mismatch] There is no effect on operations when this overflow occurs. However it causes confusion when trying to diagnose the performance problem. Signed-off-by: Dai Ngo Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- include/linux/sunrpc/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8ada7dc802d30..8f9bee0e21c3b 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -186,7 +186,7 @@ struct rpc_wait_queue { unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */ unsigned char priority; /* current priority */ unsigned char nr; /* # tasks remaining for cookie */ - unsigned short qlen; /* total # tasks waiting in queue */ + unsigned int qlen; /* total # tasks waiting in queue */ struct rpc_timer timer_list; #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS) const char * name; -- 2.43.0