Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp161801pxb; Thu, 7 Apr 2022 02:00:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyb15mNXD5hNTofq3NiCdBXPwzkpbcTbBJ5ShdJxMjBsByO0ChCV1D1oYeEQqUOY4lx3s5j X-Received: by 2002:a05:6402:4305:b0:419:2aeb:2a9b with SMTP id m5-20020a056402430500b004192aeb2a9bmr13065253edc.346.1649322041715; Thu, 07 Apr 2022 02:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649322041; cv=none; d=google.com; s=arc-20160816; b=zucxK3hAMYHUp+sfTU883L986GNmK8d0GSk1FhnZxPMwfcaMTUIQojorT2pKPlE3o1 dFSmDhUrb35H/gk5pNw3edAtFaEgP0bunYtFhyfvHZyQwgmUlwoCflYIdjPMpgDdCWSZ IUC68VP11TIQr62Bc5igO8vH2fgtOg69y9qGhX/tN7lKO6eVF3kTR6Cs/7c0oGyl3KIK ew5Txr3S7S6yGs2l0JUbeTWiPO4Qutlr0GVFoK6nx/aXXf9MwNdifwt+iRMuAOqH4AO4 dXJ8nlauH0a/qUEV9RLGTyI565SA0PfAOgoMOCB/4IahoPDspCoqy6cvHEf30kZ4x0x7 FNRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=hSOa6bR/GWqCtiQwZrRySxoVBsyfYQuY8z/QQSW6wI4=; b=hdI9wOLDV77W+w2E8WH+eFOxPBj1tQDEuDFSaoq5s2In4E/2p2VWX29dXtlyzbmLEN aE8kLqjSjhnNAmubQzX+4eKyYLvmD6acMdcPUAjD42uENlMpdpBoej4+NVqHZJGrIeM2 tMHGxb225FNyzb7UJj9Fd180NP02na16zmJyo4tBQEhfF/+b3aGk8TwzuB2+G+jc548d T7HJI/Rdqi8mxmowf5ko7dhDgd7bpUgPNb4kFovWbl3mrYXAk2kcKbYHgA+C9tD8AuEl 9qwQkVAm/7rOYufHcBaMUAuFfqIdS7dIBGTWJm57FZdGav1ZaPKv+08Mp25WDhhX6t8C Ib6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=EWO9+yQG; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u26-20020a50a41a000000b0041cdc6da92fsi6648690edb.503.2022.04.07.02.00.15; Thu, 07 Apr 2022 02:00:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=EWO9+yQG; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236943AbiDGBX1 (ORCPT + 99 others); Wed, 6 Apr 2022 21:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239108AbiDGBWg (ORCPT ); Wed, 6 Apr 2022 21:22:36 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 400765D18C; Wed, 6 Apr 2022 18:19:46 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BE1C6210EF; Thu, 7 Apr 2022 01:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649294384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSOa6bR/GWqCtiQwZrRySxoVBsyfYQuY8z/QQSW6wI4=; b=EWO9+yQG8FZdMGlTrUQLdsWIdFX1uTGYuSXPLdyNuMF6Xng2rz3RDtMpvckW52UVMilFOg iuaq3KQYAYIBNUHqmsgE9JBdxbIrtZZ1sRLH2qwzaCEdDg6gZRiIpK2HdPQgWjOtSRMbD9 86PS2Eg4jO7H3rVxPx9OkmRNiaL2RgQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649294384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSOa6bR/GWqCtiQwZrRySxoVBsyfYQuY8z/QQSW6wI4=; b=JN3y31g6yBiZtk7KZ4Z+8k7yqDz/SorKWUd2Tegg+M5+vLLyI4XqtL+CWZ2+vkImf3JFZV T7C5x9hnK04i8uBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BECC5139F5; Thu, 7 Apr 2022 01:19:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1z7SHS48TmIsfgAAMHmgww (envelope-from ); Thu, 07 Apr 2022 01:19:42 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Dave Chinner" , "Trond Myklebust" Cc: "J. Bruce Fields" , "Chuck Lever" , linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: sporadic hangs on generic/186 In-reply-to: <164929126156.10985.11316778982526844125@noble.neil.brown.name> References: <20220406195424.GA1242@fieldses.org>, <20220407001453.GE1609613@dread.disaster.area>, <164929126156.10985.11316778982526844125@noble.neil.brown.name> Date: Thu, 07 Apr 2022 11:19:34 +1000 Message-id: <164929437439.10985.5253499040284089154@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, 07 Apr 2022, NeilBrown wrote: > On Thu, 07 Apr 2022, Dave Chinner wrote: > > On Wed, Apr 06, 2022 at 03:54:24PM -0400, J. Bruce Fields wrote: > > > In the last couple days I've started getting hangs on xfstests > > > generic/186 on upstream. I also notice the test completes after 10+ > > > hours (usually it takes about 5 minutes). Sometimes this is accompanied > > > by "nfs: RPC call returned error 12" on the client. > > > > #define ENOMEM 12 /* Out of memory */ > > > > So either the client or the server is running out of memory > > somewhere? > > Probably the client. There are a bunch of changes recently which add > __GFP_NORETRY to memory allocations from PF_WQ_WORKERs because that can > result in deadlocks when swapping over NFS. > This means that kmalloc request that previously never failed (because > GFP_KERNEL never fails for kernel threads I think) can now fail. This > has tickled one bug that I know of. There are likely to be more. > > The RPC code should simply retry these allocations after a short delay. > HZ/4 is the number that is used in a couple of places. Possibly there > are more places that need to handle -ENOMEM with rpc_delay(). I had a look through the various places where alloc can now fail. I think xdr_alloc_bvec() in xprt_sent_pagedata() is the most likely cause of a problem here. I don't think an -ENOMEM from there is caught, so it could likely filter up to NFS and result in the message you got. I don't think we can easily handle failure there. We need to stay with GFP_KERNEL rely on PF_MEMALLOC to make forward progress for swap-over-NFS. Bruce: can you change that one line back to GFP_KERNEL and see if the problem goes away? The other problem I found is that rpc_alloc_task() can now fail, but rpc_new_task assumes that it never will. If it does, then we get a NULL deref. I don't think rpc_new_task() can ever be called from the rpciod work queue, so it is safe to just use a mempool with GFP_KERNEL like we did before. NeilBrown