From patchwork Thu Jun 13 08:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13696343 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 148B4142627 for ; Thu, 13 Jun 2024 08:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267322; cv=none; b=eZwU2AM7KWtrkFYlZzueGSDeo7njQof784SW8cYxwvWZiWmtJSe5Q/VJLA8bl++DF/uBNo3NIlJ+8CIF0fXzkVdJaS54f+EfAQ6FuAwbe81lPJpumMgpY2l4VWjS/k3CStGV02s5xLZKKhYBrZf8+03UQw1VHe+slmSy/IGTfLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267322; c=relaxed/simple; bh=BOOXcQyyrcRDp1avX+twre5ldUqhQzRZ5CzX8/W4OtQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EGenDLHpkollVPVrEHsPNxW5aYgrL9MmleAp2jioDyN/3DNDroaTg68Yp2wt+RKwiZsWHtZ0NSPJnf9fYIozlwZ0GXJLRuOFz+Hr0kfNqAdHpD2FhCyto3sSYYxyN8ANPIQoaHyaXuAtCEGRQRN07k4KGyMw0/ZQ7Wl8BK3FMI4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=pzCWfOjZ; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=NjGoWyJf; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Iysvj9RQ; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=EQ7RWIdb; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="pzCWfOjZ"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="NjGoWyJf"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Iysvj9RQ"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="EQ7RWIdb" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E55DE350EC; Thu, 13 Jun 2024 08:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718267318; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uy1oMQ7hbYL3cewFkWjvf7wnviigrne+bNEArHf9amM=; b=pzCWfOjZik47g6dGJ7FSnnVKiOu+85q3EdjK5jQBtdwDkd2KFhLHFBaEQr9ufiX/r3hO/m osd68iCNs4A0EfXIi5AyotzhAnRKeyO+nLRL+ULJ/7tNNDibJerX1uP3JIr0iXNRn8nACZ 5MQdaIQZQq9UAHx0Oo+3+dDnX0nqk2g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718267318; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uy1oMQ7hbYL3cewFkWjvf7wnviigrne+bNEArHf9amM=; b=NjGoWyJf6r5Br4am0gNvFy5oTkaBp8wRu6/fbQWznAYNhGUiTRbxVq9kKUWbjHjO4/e34Q RjHDXUdyEkZusfAA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Iysvj9RQ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=EQ7RWIdb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718267316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uy1oMQ7hbYL3cewFkWjvf7wnviigrne+bNEArHf9amM=; b=Iysvj9RQObQFYRzFZQvYh73JfdEXIKntKv8l9M5GX4iDWDTwAxzy6Tif8G57CiNcjVnpSR rg5h5lMoK3yccPvTNayTdevXqkU0EYEa3sBSjDbRNbikKT0C6daOyF17amCap7YC/w+t6c Re2XmzEf1i+6MwyE8Cgcnla6H1AnRDI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718267316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uy1oMQ7hbYL3cewFkWjvf7wnviigrne+bNEArHf9amM=; b=EQ7RWIdb92qI0ps9/f8IJAaOtjoJVMNpF65RNOXt4b7P65qzIgWfUyVZXfRRJjdAxuUWz4 8BrQlGQK13JiIsAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D901113AA0; Thu, 13 Jun 2024 08:28:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id ZevvNLStamY9XAAAD6G6ig (envelope-from ); Thu, 13 Jun 2024 08:28:36 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 79A37A082D; Thu, 13 Jun 2024 10:28:21 +0200 (CEST) From: Jan Kara To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, Neil Brown , Jan Kara Subject: [PATCH 1/3] nfs: Drop pointless check from nfs_commit_release_pages() Date: Thu, 13 Jun 2024 10:28:17 +0200 Message-Id: <20240613082821.849-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240612153022.25454-1-jack@suse.cz> References: <20240612153022.25454-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1129; i=jack@suse.cz; h=from:subject; bh=BOOXcQyyrcRDp1avX+twre5ldUqhQzRZ5CzX8/W4OtQ=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmaq2hKxU+UB2pPUbePY/qWx+kRuZSeXtTLlIRW82x IM0z/HqJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZmqtoQAKCRCcnaoHP2RA2amyB/ 0dbAXoBmLklndtVK2kkpuk/Ukd9lKkizAVWC5fCNKA+9sK7qprgVzlgU3fDXQduUdJOGrt8XdU68Iv 9btwyfsoMPcEJ3IjXmQPnM1MNLB759AZD5uTt0cq7fgBNvXKa+LJCOh222LZ7cDGf0pD1O9DKMlpeu m3vR7c35L+wkaoBX2MHZlePe1zuFtTyG4a8EzENAiomzHA9AnM8nfjNziqnQu9zjuJwIDZD/WJeybC z3sTRNYqHu8E9cHOLmNKv4uBeNlxXFO4DQ0YT7ZD3qWASSs3lypiOQ7S6K3QanPEZDTgh46koQ/A6p WgsKA8g4zSj3xW53YkN1o6OS5/8U9b X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Rspamd-Queue-Id: E55DE350EC X-Spam-Score: -3.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.cz:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email,suse.cz:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org nfss->writeback is updated only when we are ending page writeback and at that moment we also clear nfss->write_congested. So there's no point in rechecking congestion state in nfs_commit_release_pages(). Drop the pointless check. Signed-off-by: Jan Kara Reviewed-by: Sagi Grimberg Reviewed-by: Jeff Layton --- fs/nfs/write.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 5fc12a721ec3..c6255d7edd3c 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1837,7 +1837,6 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data) struct nfs_page *req; int status = data->task.tk_status; struct nfs_commit_info cinfo; - struct nfs_server *nfss; struct folio *folio; while (!list_empty(&data->pages)) { @@ -1880,9 +1879,6 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data) /* Latency breaker */ cond_resched(); } - nfss = NFS_SERVER(data->inode); - if (atomic_long_read(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) - nfss->write_congested = 0; nfs_init_cinfo(&cinfo, data->inode, data->dreq); nfs_commit_end(cinfo.mds); From patchwork Thu Jun 13 08:28:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13696341 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 2EABA13D51F for ; Thu, 13 Jun 2024 08:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267322; cv=none; b=Q1ri4YycV2+sKXXBKc3b5MS4UwpRCG8hV2hrV7DQxABaApesbwi/jGLrYJhbmZrZu1s98dxzuWINBYIN6VgamYMSl0JVbGCh5Z7gn0lqLnD4lPaQpA4aYGXrt7Bua22gZWv8NsFYU5tPt2OOZ6tYbGMJSNgrdqO6grlXcQgneGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267322; c=relaxed/simple; bh=DY8AglSEqJ2V5wGwE1jSoYjtETgB7p7ptF7rYPzQfeI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LSpBChus0iQquQqKfFxcXJR9Yl0hcZP/18KO4Q7SnCrEOpzxIlRxxHzVouY0ZXAWd2OXf78/BuhiUG18SQkVqO2vorfhY2GvwhfncX7R7/Bhr6dWrsOXUHAvmjVaOGwkmv20GLj2cQMmjZA3KZt0dMvf3Pd4gMZAlxOr5FP0rgA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=IxHBUXZr; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=r7ePrbuf; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=kTvPyopD; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=7+fkAX6R; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="IxHBUXZr"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="r7ePrbuf"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="kTvPyopD"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="7+fkAX6R" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F118F5D008; Thu, 13 Jun 2024 08:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718267318; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d/c/ksSl9a6tlSWlpt55jFzAy3CDGUbd8VqyAbiaI0A=; b=IxHBUXZrWxfJ4AHnjV0Mkafj/7NCWHsSiXo0ZzwlScox4uCpBLaxcZ4nnQJG0rRfGtnDYF 4w2OeIP99F0PtC1b+BmmQ7gNeut6WpqKs8YMZdy239ERCt54Rjwp06xh4thOHLS8cq1Jt8 Ucb/QxD5j29bllSkGqoMJMXk+n/hBQE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718267318; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d/c/ksSl9a6tlSWlpt55jFzAy3CDGUbd8VqyAbiaI0A=; b=r7ePrbuftRWQd/It9Hoa7ojii/I8vs0PObLRK+uLaueM68Yh7wrSduUhQ0baTmY8DGJrj0 uUT+XHpkgCbGckDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718267316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d/c/ksSl9a6tlSWlpt55jFzAy3CDGUbd8VqyAbiaI0A=; b=kTvPyopD0iGM0p54uBcy5z0MrqHX2lrmNTnYghsbOdaYigXxWWoZzaI6pWZ8RJVLC1llkP 1Q7LeIx2XB7MkZ/OX0Mfu4TPb7Zy7qiGgNsR+sxiaixXKXYllrmUQqzYciRkTMjfY8o5J/ gph6DG2NmjVumAcdiZRCTgGGgGV1Dc4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718267316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d/c/ksSl9a6tlSWlpt55jFzAy3CDGUbd8VqyAbiaI0A=; b=7+fkAX6ROU2YF6/91mUOUAxyO7eC4OleCrDGy7dopI35AY9/KZKRgo6C1xPnFyxKyEkVLe 3M0lqnFXvBAN99Aw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E504213AB5; Thu, 13 Jun 2024 08:28:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id opVUN7StamZBXAAAD6G6ig (envelope-from ); Thu, 13 Jun 2024 08:28:36 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 819A0A088A; Thu, 13 Jun 2024 10:28:21 +0200 (CEST) From: Jan Kara To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, Neil Brown , Jan Kara Subject: [PATCH 2/3] nfs: Properly initialize server->writeback Date: Thu, 13 Jun 2024 10:28:18 +0200 Message-Id: <20240613082821.849-2-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240612153022.25454-1-jack@suse.cz> References: <20240612153022.25454-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=664; i=jack@suse.cz; h=from:subject; bh=DY8AglSEqJ2V5wGwE1jSoYjtETgB7p7ptF7rYPzQfeI=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmaq2hSW/npDwR3m9WDs54716PPIqNh2L522zTrbmY X9lQCuyJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZmqtoQAKCRCcnaoHP2RA2TWnB/ 9x4/wQtiumA4/Veiy02wqM1OXVZdGfLMN3UWnFtf3ChoQctC+ORrYqq30n01ZtJzpP/LvJUElcxkQy f9S6h/WfUeXSqrHuT0d/z4O5lyGryQMCCOGjuvhD+/uU+BXI3W8YeQXhyvpShtYXAcks1TRdnKFAEJ bY3xrwH+8uQ29o90h1udMej3xyqSAAjG4vtXgLXl7NhFCWxWjS2V14SFLS7G9k9FItYxm1YVqTPrG+ Tpq4OgCHu5OItnZGO6SH8oZuDUhST7B/OlEh8IvpmAci+KjvWI8m5Qt0ws8maiyYJPcy2Cu40uU3qZ QTS9yNV9UhmXqGyHRmXDTqk5Plao49 X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.cz:email] X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: Atomic types should better be initialized with atomic_long_set() instead of relying on zeroing done by kzalloc(). Clean this up. Signed-off-by: Jan Kara Reviewed-by: Sagi Grimberg --- fs/nfs/client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index de77848ae654..3b252dceebf5 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -994,6 +994,8 @@ struct nfs_server *nfs_alloc_server(void) server->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED; + atomic_long_set(&server->writeback, 0); + ida_init(&server->openowner_id); ida_init(&server->lockowner_id); pnfs_init_server(server); From patchwork Thu Jun 13 08:28:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13696342 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 127B713E03B for ; Thu, 13 Jun 2024 08:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267322; cv=none; b=BGL3aRTi1mLG5fJpDo/i36rRWmy3wXrWgDNkNVmqW5qS2UH60d7OVlSfsMQLLKLGDw9HheeKxk8D3iZvQwZE9Rwzt1fBK6IDngLdE5RJQNKR94JRyA45VdU6EOaoP8enjkDOuVF9PdcxA/3CqZ3ydtqY3DS92wTNFlyDIfuuTdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267322; c=relaxed/simple; bh=HSnYnQ8CSQe3BnAYyevrYC7xyJa9NpzptogQ7j3U9YU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=snnl6dvrcU7FOTyFuNN4lK63a0ZV1qD3OTlLSaL1bcRlCeszcDmxnCQMI9GWozaR12c7NePHNnMzPAYD7spLqTqa1Dtm7I5+CYOboK+4HVM1kQwEjPDu453UqzDQQZry412FtdZ8+poVg+D1QRVeXdH8NtNeC/eqdVEhHvOKpNg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=qqr5+08j; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=H4JvH915; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Hzc9anyF; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=md9O0Ijp; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="qqr5+08j"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="H4JvH915"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Hzc9anyF"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="md9O0Ijp" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EEA8B5D007; Thu, 13 Jun 2024 08:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718267318; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5nwBAYFD0cdcZNWh3+SGlT6ixsCG461/5j6ErYY3ec=; b=qqr5+08j2TTDnScEecEUIiVqJqp8ZfmLhYcwJxVN6w4keXsrzUJTskSkYW71eDseV+0PGp r6KjuDzsR6jGeemTrCBRNJurDcWs5q8LkFYWNPVWOzuNB02ZfwNQmJgoQG/z8Iic5ieC3z ud6qA7d87YMd/TRlXSdxn/xk0HQBP6s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718267318; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5nwBAYFD0cdcZNWh3+SGlT6ixsCG461/5j6ErYY3ec=; b=H4JvH915aEKcHFVaFmIXa8PJOIMYHkTOV+m5bP2/4agfQj8ivgZFEwCy+2omLYLxId08+1 +ng3nc3Oi/1tJGAQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Hzc9anyF; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=md9O0Ijp DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718267316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5nwBAYFD0cdcZNWh3+SGlT6ixsCG461/5j6ErYY3ec=; b=Hzc9anyFKtlPziOFQIl02VOak66WvqNd4uKpiyDmqm6/N1RVu0nMQeCsSp1WNUIv7aJK/Q nEDWQ2PVsq729PmYOxkN4pbqe9WYsPcV/ZdNlZNJK8UpPOOTdwZRQiMd9i3AE3oqNQNnjh mvu/niD/Yh2/sVBCh4q9PIBvr6KGaiE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718267316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T5nwBAYFD0cdcZNWh3+SGlT6ixsCG461/5j6ErYY3ec=; b=md9O0IjprB8jr+OhsOko7sAb5vadkWi1KPiq2VHYrLJ4TR38mWkHsEfAlLgY647ICo8zxu P9Fhi+4ZJ4/4yVAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E17CC13AB2; Thu, 13 Jun 2024 08:28:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id yzQIN7StamY+XAAAD6G6ig (envelope-from ); Thu, 13 Jun 2024 08:28:36 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 87DE6A088D; Thu, 13 Jun 2024 10:28:21 +0200 (CEST) From: Jan Kara To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, Neil Brown , Jan Kara Subject: [PATCH 3/3] nfs: Block on write congestion Date: Thu, 13 Jun 2024 10:28:19 +0200 Message-Id: <20240613082821.849-3-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240612153022.25454-1-jack@suse.cz> References: <20240612153022.25454-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3821; i=jack@suse.cz; h=from:subject; bh=HSnYnQ8CSQe3BnAYyevrYC7xyJa9NpzptogQ7j3U9YU=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBmaq2ioOgGKmwXNoTZjbhRTF19r8jjM+ymUSRvMFHh BTyIRpyJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZmqtogAKCRCcnaoHP2RA2XcMCA C9FaCjzVKrJvgI1zsMy9znQvzcW4YPmSyiwlGieTyftzTcaoi1amj2ZaW1taogisEoAEQnrIIVvW/w ApyvvhoiFbzVo0CPDre2SQAefG4cmzSz3hlOhn02yiYyHBuRjrf7WXDCF52K76BSorQLHoFoQaFB01 Zbwt3VuYJvRA+wol0nxG8hQKqu4FB8EFW6c/zfmJnKmU/qXl5KmOBVWmPEss4lp++wS67pwNaQp7CA 18FSqcjo2tP+MAjE2/cimod4etIYhRagy77gtXKmIS2rQZPEYlYpoocSkHg0NyWuWO8dGHyIqbUTFe rE2QpvVWnsAfrQYaDjWjjifsH/XTSs X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Rspamd-Queue-Id: EEA8B5D007 X-Spam-Score: -3.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.cz:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email,suse.cz:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Commit 6df25e58532b ("nfs: remove reliance on bdi congestion") introduced NFS-private solution for limiting number of writes outstanding against a particular server. Unlike previous bdi congestion this algorithm actually works and limits number of outstanding writeback pages to nfs_congestion_kb which scales with amount of client's memory and is capped at 256 MB. As a result some workloads such as random buffered writes over NFS got slower (from ~170 MB/s to ~126 MB/s). The fio command to reproduce is: fio --direct=0 --ioengine=sync --thread --invalidate=1 --group_reporting=1 --runtime=300 --fallocate=posix --ramp_time=10 --new_group --rw=randwrite --size=64256m --numjobs=4 --bs=4k --fsync_on_close=1 --end_fsync=1 This happens because the client sends ~256 MB worth of dirty pages to the server and any further background writeback request is ignored until the number of writeback pages gets below the threshold of 192 MB. By the time this happens and clients decides to trigger another round of writeback, the server often has no pages to write and the disk is idle. To fix this problem and make the client react faster to eased congestion of the server by blocking waiting for congestion to resolve instead of aborting writeback. This improves the random 4k buffered write throughput to 184 MB/s. Signed-off-by: Jan Kara Reviewed-by: Sagi Grimberg Reviewed-by: Jeff Layton --- fs/nfs/client.c | 1 + fs/nfs/write.c | 12 ++++++++---- include/linux/nfs_fs_sb.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 3b252dceebf5..8286edd6062d 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -994,6 +994,7 @@ struct nfs_server *nfs_alloc_server(void) server->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED; + init_waitqueue_head(&server->write_congestion_wait); atomic_long_set(&server->writeback, 0); ida_init(&server->openowner_id); diff --git a/fs/nfs/write.c b/fs/nfs/write.c index c6255d7edd3c..21a5f1e90859 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -423,8 +423,10 @@ static void nfs_folio_end_writeback(struct folio *folio) folio_end_writeback(folio); if (atomic_long_dec_return(&nfss->writeback) < - NFS_CONGESTION_OFF_THRESH) + NFS_CONGESTION_OFF_THRESH) { nfss->write_congested = 0; + wake_up_all(&nfss->write_congestion_wait); + } } static void nfs_page_end_writeback(struct nfs_page *req) @@ -698,12 +700,14 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) struct nfs_pageio_descriptor pgio; struct nfs_io_completion *ioc = NULL; unsigned int mntflags = NFS_SERVER(inode)->flags; + struct nfs_server *nfss = NFS_SERVER(inode); int priority = 0; int err; - if (wbc->sync_mode == WB_SYNC_NONE && - NFS_SERVER(inode)->write_congested) - return 0; + /* Wait with writeback until write congestion eases */ + if (wbc->sync_mode == WB_SYNC_NONE && nfss->write_congested) + wait_event(nfss->write_congestion_wait, + nfss->write_congested == 0); nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGES); diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 92de074e63b9..38a128796a76 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -140,6 +140,7 @@ struct nfs_server { struct rpc_clnt * client_acl; /* ACL RPC client handle */ struct nlm_host *nlm_host; /* NLM client handle */ struct nfs_iostats __percpu *io_stats; /* I/O statistics */ + wait_queue_head_t write_congestion_wait; /* wait until write congestion eases */ atomic_long_t writeback; /* number of writeback pages */ unsigned int write_congested;/* flag set when writeback gets too high */ unsigned int flags; /* various flags */