Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp547114rdb; Thu, 8 Feb 2024 13:33:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVeXhkJiWfPdKeLa1H8Zz4wDQXvfsiut85zs8gr23Ji0C8Sck8nqJbIT8ODKj2Z4rij2ihen1v3iBDqkBJvScBwfH7BweZ/6jC29Kjygw== X-Google-Smtp-Source: AGHT+IEb3odhOeJMGTouo0vfBM3LjSUQrJyG1yrAAQ/rVbcjiQpAS5I9gQp5Cack4vyplqSwLY11 X-Received: by 2002:a05:6870:2013:b0:219:9253:e5aa with SMTP id o19-20020a056870201300b002199253e5aamr845782oab.8.1707428004657; Thu, 08 Feb 2024 13:33:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707428004; cv=pass; d=google.com; s=arc-20160816; b=VoF1UTSdHKXNxCQleSfdf6VNGHcWNb6j2u3uQvb3QxQpFjD22n3a5ycolKZIYT0A0/ fe0dMNqgS9vKSo7VOGetLTDg1AuPMQ3hHNp0v6VyIjyaPBhdrJsRK2Skwf1Az3Gats2z apGPoCRo3eIBi+XwhYoisvkmUeGWXeVNv/U0aRsSHHM2YDCpwrt7fr4UaARqt1GqShCI U94IeMTZWvUM9hsOgpkYFjDj3LhiQKnrKqNx5Ueu5TAlpbtfWlfyt2YMPqtORGe7eJeI YVozNBJMM8ueG4XTaQJZ+5ZapIqBBpG5DlAoGaVmp/gw8FeIuuZciCMImT06KMCfkL2M MXTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=p5F5XeobeaU/MWNlsZIdAqzWUQ96V9yqaF96JqHznkk=; fh=ndhvXH6eqcXtVNf7Ef/5XKeuRRCYYKfNxNOax0IWRJg=; b=spugzZiq+EUM9aSSYxLyi9uGK+P9kEmX5rLjXxdnnFKKT3ov0VC37hYDWO7KvuhF3M XxKf353jBEkCHF7Cg3mYM9xLRClWSRQy7nkh4drLg15MwgHBFmqI+gVTOd+8iRKlmZ4h nYUkcMd8u/ryR7FBy+DED22xGcRVQ7nEGLmDQrO4uk2m3v95qePvOAQYzhrJXfFPIK07 rHUHr3jv/wCAF6BGEpU5gwLUWzVI+iDpdzF3vSza3b2fm6iEY/zoL99H4GSrRxsoMk4t likXSmYsrLqqeHWcGSpXRBe/Q9y00VMp4bGz+ZDGWNzzqIt8NxHblxtG6tzIA/JtKuQe mOXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tyu4EKQy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXpuZiJeo9EPJR/Y/0tQWOrpGAy+hoVS6KIDsujh1sb2jf4kBqyDGhMXCuYRuxxTPlM7FoQVVK3Dwfq3H/xK3I99AnVE9mwFuz3pZ7irw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id dr14-20020a056a020fce00b005cfbedffb59si426987pgb.118.2024.02.08.13.33.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 13:33:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tyu4EKQy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58724-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2DE58281904 for ; Thu, 8 Feb 2024 21:33:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A0CF4F5E4; Thu, 8 Feb 2024 21:33:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tyu4EKQy" 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 3C65148CC6; Thu, 8 Feb 2024 21:33:15 +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=1707427995; cv=none; b=E5O75ee/CMwHUsdUyqPw6NbcIBm4JUIhFp7ZLIk2U7KLBrV91O37YLxDxXVUUjqTacVwSH7YeFU7Ij0/ztQF9zv2vuG6vL9dZK5XHNebPrHQ2LWDvDQmnCXEAFT+2DrgcE+f1K2F+lBAdsFcnr1MPfuy3l0IgxftGU9h1pLr7+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707427995; c=relaxed/simple; bh=yo5vnXHyIx1FjoDcm/XP6Pmz2W7lO68ZWNXRyinSzU0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=S+WriaTXvYZQ7QV3PpCZ5TT9mAT8Fub1vM5g4zhMN5KS6NeA16W+gg+EepXNTSs/DKR6ApLwMF9apjcfdj9Q8IohBxcEzjLAvQqkZnZHkGmTmJ/sA1Lf8eF0Xnd3py1XasVZa/Vt8ErkIhl+CGN49wunZWj3yLXsDqyrSVokN50= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tyu4EKQy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDA95C433C7; Thu, 8 Feb 2024 21:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707427995; bh=yo5vnXHyIx1FjoDcm/XP6Pmz2W7lO68ZWNXRyinSzU0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Tyu4EKQyJh2dKk37zRS2anU8j/iZ2zwUN7w5kpYFhTWzXsiJ6MP+JQW0L4K8ZG1wT cvGVZ++h8vKACSSugeZQQWuRVkVtah7vp2UBq2YuEMkzv51hNDaz2TOcOgEv8WFfrU CXeBCRacRwBGPCZPPP00L9xBxt9AEaW6DB0GfgIPrgwLb05lqVcoJCdyYOrNAaDlgu PrPAfauiA48Ox1EeTs+pE2Z8+RpZ0zGZX9j+RLDOXz9XA6cK1k61aec/0+dzYjhiY9 eO5f8BWrvF5bm7fWS5CK2ojmoCXn2ZNGNfryDtB+xBYpl4RvRlwwuLPAlPrejVfh5f MQZO0aFZCVEKw== Date: Thu, 8 Feb 2024 15:33:13 -0600 From: Bjorn Helgaas To: Christophe JAILLET Cc: Bjorn Helgaas , Logan Gunthorpe , Eric Dumazet , alexis.lothore@bootlin.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH] PCI/P2PDMA: Fix a sleeping issue in a RCU read section Message-ID: <20240208213313.GA973325@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02d9ec4a10235def0e764ff1f5be881ba12e16e8.1704397858.git.christophe.jaillet@wanadoo.fr> On Thu, Jan 04, 2024 at 08:52:35PM +0100, Christophe JAILLET wrote: > It is not allowed to sleep within a RCU read section, so use GFP_ATOMIC > instead of GFP_KERNEL here. > > Fixes: ae21f835a5bd ("PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma") > Signed-off-by: Christophe JAILLET Applied with Logan's Reviewed-by to pci/p2pdma for v6.9, thanks! > --- > This patch is speculative. > It is based on a discussion related to another patch. See [1]. > > It also matches the doc, IIUC. See [2] > > [1]: https://lore.kernel.org/all/20240104143925.194295-3-alexis.lothore@bootlin.com/ > [2]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/RCU/whatisRCU.rst#n161 > --- > drivers/pci/p2pdma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c > index 0c361561b855..4f47a13cb500 100644 > --- a/drivers/pci/p2pdma.c > +++ b/drivers/pci/p2pdma.c > @@ -661,7 +661,7 @@ calc_map_type_and_dist(struct pci_dev *provider, struct pci_dev *client, > p2pdma = rcu_dereference(provider->p2pdma); > if (p2pdma) > xa_store(&p2pdma->map_types, map_types_idx(client), > - xa_mk_value(map_type), GFP_KERNEL); > + xa_mk_value(map_type), GFP_ATOMIC); > rcu_read_unlock(); > return map_type; > } > -- > 2.34.1 >