From patchwork Tue Mar 22 01:16:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12787996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5D1AC433F5 for ; Tue, 22 Mar 2022 01:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234628AbiCVBXz (ORCPT ); Mon, 21 Mar 2022 21:23:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234621AbiCVBXy (ORCPT ); Mon, 21 Mar 2022 21:23:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A2B1DA77 for ; Mon, 21 Mar 2022 18:22:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5A686B81AFD for ; Tue, 22 Mar 2022 01:22:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE3ACC340E8; Tue, 22 Mar 2022 01:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647912145; bh=uMjNaDhQikir6YSCGCjDm3nJKvfqJTQRvB1VWIwdQC4=; h=From:To:Cc:Subject:Date:From; b=GoHGwPMKwIlZEGVzGo9qKWAs2u0S5BSusM6zyVwNb5stPcU81t8msF3kOOBiViVEm S+OOllUR01CdD8wsUsZObcHQSWV0e9LnlQgSrWXxr2rMbGdhGdomxkzx6z0elNZjZu OCAQjAwb6cPQpPZxRkKnxiTbyIFPIcsQNnetVK48WLKCciTmbgJpMcWj/o/L5tP30X QsxZ23DzVtd6kztZ4hhziJgyMFUX+1ExsPGGDyH9F5b90RhcB4kzpgOALPHZQcRSnD J5crxIvrUUxS0+6mVx4aTw5zGtuC8aV4xzgP9TSScDYQupGVdNXz6TxQDbMD91uZSz LjN7au7Racb8A== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: Neil Brown Subject: [PATCH v2 0/9] Crossing our fingers is not a strategy Date: Mon, 21 Mar 2022 21:16:09 -0400 Message-Id: <20220322011618.1052288-1-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust We'd like to avoid GFP_NOWAIT whenever possible, because it has no fall- back reclaim strategy for dealing with a failure of the initial allocation. At the same time, memory pools appear to be suboptimal as an allocation strategy when used with anything other than GFP_NOWAIT, since they cause threads to hang upon failure. This patch series therefore aims to demote the mempools to being a strategy of last resort, with the primary allocation strategy being to use the underlying slabs. While we're at it, we want to ensure that rpciod, xprtiod and nfsiod all use the same allocation strategy, so that the latter two don't thwart our ability to complete writeback RPC calls by getting blocked in the mm layer. Trond Myklebust (9): NFS: Fix memory allocation in rpc_malloc() NFS: Fix memory allocation in rpc_alloc_task() SUNRPC: Fix unx_lookup_cred() allocation SUNRPC: Make the rpciod and xprtiod slab allocation modes consistent NFS: nfsiod should not block forever in mempool_alloc() NFS: Avoid writeback threads getting stuck in mempool_alloc() NFSv4/pnfs: Ensure pNFS allocation modes are consistent with nfsiod pNFS/flexfiles: Ensure pNFS allocation modes are consistent with nfsiod pNFS/files: Ensure pNFS allocation modes are consistent with nfsiod fs/nfs/filelayout/filelayout.c | 2 +- fs/nfs/flexfilelayout/flexfilelayout.c | 50 +++++++++++--------------- fs/nfs/internal.h | 7 ++++ fs/nfs/nfs42proc.c | 2 +- fs/nfs/pagelist.c | 10 +++--- fs/nfs/pnfs.c | 39 +++++++++----------- fs/nfs/pnfs_nfs.c | 8 +++-- fs/nfs/write.c | 34 +++++++++--------- include/linux/nfs_fs.h | 2 +- include/linux/sunrpc/sched.h | 1 + net/sunrpc/auth_unix.c | 18 +++++----- net/sunrpc/backchannel_rqst.c | 8 ++--- net/sunrpc/rpcb_clnt.c | 4 +-- net/sunrpc/sched.c | 31 ++++++++++------ net/sunrpc/socklib.c | 3 +- net/sunrpc/xprt.c | 5 +-- net/sunrpc/xprtsock.c | 11 +++--- 17 files changed, 123 insertions(+), 112 deletions(-)