Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp128460rdh; Mon, 18 Dec 2023 13:56:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLEVzwBTHE/KuhHHuRqHsF1FLlkSKPJaxZBTC1BX+IcneBcYlgr4q62Df3w4gYA73Tdnp0 X-Received: by 2002:a81:5f08:0:b0:5e2:6d88:5b41 with SMTP id t8-20020a815f08000000b005e26d885b41mr6367651ywb.16.1702936560456; Mon, 18 Dec 2023 13:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936560; cv=none; d=google.com; s=arc-20160816; b=0SjCW8cYUQcrdblPg0uz4PTkSXnSN8VzmvItPiFjFcQe7LvNS+UsgmgcRQ84diWf7m RVjuS0Uz+jvs0OTwBsqhwBoPCtQIuzOwqXMSHN8M9IUYsc0dyMSgfH/yuIlVcArgQcr5 Nvw71nipXqc5XYEKzEf11pkS/QE8Nn87JUwKshH9l14JxlTxzj4EADa2N+MjzW/LheIA sZB/CNVbJ4ksyZfv9TmO7A+0N7RRUfjF0dnL4ebp8t5Vs0KjpgAnhmO/vVQuCjR87gUW 1OcyJPFPbcRk41G9AzRUOoZDGxrG2nHY7lviDrTlfRqO0RUSi6vmIrSFsROYM7hlHPvl cCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:to:from:date:dkim-signature; bh=YeUjgxtgDOYlUIHkPW4Med7YaP/UHtPOrtGztdaBZ3w=; fh=OaMzxmvbeUv4iQNH6ZKUeeFWGf376+mZ6QUrMegmPog=; b=Dr3QDn4fe4fzG+ew2/pKLBIcfOCP313aY8oy/liOQ1rRqSJ4xJ6nYHA8vLSzGWq3JV EqdhHzYj8+KkBAyTry9R1ZLh9bBmRJ3JtYyf9mSJlsizkfPSH8GqQTKTKLR/0VE3EStM /Mv15xXp1j+cBLxfOzNlQinMeJrU+MTGquBo903iHYhpxAk9jWtmWvt7FH+QgGLB0/5t 3ta8plsLCVub4Jet8sTmkR5RCArN6ErnyFAjiBn+9XqSOfqhsct0NlrMdpZZhB5+axe6 aHJRyOVCHFpp+lrZTgHA/GGXnYZIbR9oZpVBNNqVusGcCGb2ufFe7caU3/oIp3d5sUOT XkKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@morinfr.org header.s=20170427 header.b=IS5PK0Bo; spf=pass (google.com: domain of linux-nfs+bounces-697-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-697-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=morinfr.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s14-20020ae9f70e000000b0077f8d2bb62bsi14091310qkg.706.2023.12.18.13.56.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:56:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-697-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=fail header.i=@morinfr.org header.s=20170427 header.b=IS5PK0Bo; spf=pass (google.com: domain of linux-nfs+bounces-697-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-697-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=morinfr.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1F7431C21F65 for ; Mon, 18 Dec 2023 21:56:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 967A9740A2; Mon, 18 Dec 2023 21:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=morinfr.org header.i=@morinfr.org header.b="IS5PK0Bo" X-Original-To: linux-nfs@vger.kernel.org Received: from smtpfb2-g21.free.fr (smtpfb2-g21.free.fr [212.27.42.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84AFF74E1A for ; Mon, 18 Dec 2023 21:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=morinfr.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=morinfr.org Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by smtpfb2-g21.free.fr (Postfix) with ESMTP id AF5584C842 for ; Mon, 18 Dec 2023 22:46:31 +0100 (CET) Received: from bender.morinfr.org (unknown [82.66.66.112]) by smtp2-g21.free.fr (Postfix) with ESMTPS id 161A12003F6; Mon, 18 Dec 2023 22:46:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=morinfr.org ; s=20170427; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YeUjgxtgDOYlUIHkPW4Med7YaP/UHtPOrtGztdaBZ3w=; b=IS5PK0BoJdaBiKD9k8p81wo6u3 ke1+/2R5qYN1iny3NkiSA4b0jRc2YMr5aBfD/cEmiaLbc5lx4i0Gn9pHB3AtWkWUkTJgK2Qu3czCT bsDsUuqczgc6XL3mxPAhm4qywCYlSoay/jtyugtDxL5nkPxRFPq3F7FWW9awT19eH4+w=; Received: from guillaum by bender.morinfr.org with local (Exim 4.96) (envelope-from ) id 1rFLRO-0057gv-1g; Mon, 18 Dec 2023 22:46:22 +0100 Date: Mon, 18 Dec 2023 22:46:22 +0100 From: Guillaume Morin To: chuck.lever@oracle.com, linux-nfs@vger.kernel.org Subject: SUNRPC: crash from svc_alloc_arg() Message-ID: Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Chuck, I believe commit 5f7fc5d "SUNRPC: Resupply rq_pages from node-local memory" in Linux 6.5+ is incorrect. It passes unconditionnaly rq_pool->sp_id as the NUMA node. While the comment in the svc_pool declaration in sunrpc/svc.h says that sp_id is also the NUMA node id, it might not be the case if the svc is created using svc_create_pooled(). svc_created_pooled() can use the per-cpu pool mode therefore in this case sp_id would be the cpu id. from __svc_create: for (i = 0; i < serv->sv_nrpools; i++) { struct svc_pool *pool = &serv->sv_pools[i]; dprintk("svc: initialising pool %u for %s\n", i, serv->sv_name); pool->sp_id = i; When using the cpu-mode, this triggers a BUG on my machine: BUG: unable to handle page fault for address: 0000000000002088 #7 [ffffafa3dc42fc90] asm_exc_page_fault at ffffffffa3e00bc7 [exception RIP: __next_zones_zonelist+9] RIP: ffffffffa32fbbc9 RSP: ffffafa3dc42fd48 RFLAGS: 00010286 RAX: 0000000000002080 RBX: 0000000000000000 RCX: ffff8ba5f22bafc0 RDX: ffff8ba5f22bafc0 RSI: 0000000000000002 RDI: 0000000000002080 RBP: ffffafa3dc42fdc0 R8: 0000000000002080 R9: ffff8ba62138c2d8 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000cc0 R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000001 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #8 [ffffafa3dc42fd50] __alloc_pages at ffffffffa334c122 #9 [ffffafa3dc42fdc8] __alloc_pages_bulk at ffffffffa334c519 #10 [ffffafa3dc42fe58] svc_alloc_arg at ffffffffc0afc0d7 [sunrpc] #11 [ffffafa3dc42fea0] svc_recv at ffffffffc0afe08d [sunrpc] #12 [ffffafa3dc42fec8] nfsd at ffffffffc0dec469 [nfsd] #13 [ffffafa3dc42fee8] kthread at ffffffffa30e4826 I believe the fix is to expose svc_pool_map_get_node() and use that in the alloc_pages_bulk_array_node() call in svx_xprt.c. Reverting 5f7fc5d would obviously work as well. The comment in svc.h should probably be updated as well since it's misleading. I didn't provide a patch because I wasn't quite sure which approach you would prefer but could provide one if that's helpful. HTH Guillaume. -- Guillaume Morin