Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2346457lqo; Mon, 13 May 2024 16:03:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYUvUrw+0TRo0ESKBUkWU4zTXC4q8f6XqAKOZQ55nCycr3TNqTdg57XFY4PDw+fevABpMRzAyKB2TbcxcmvmGhWj1GxY5fNXNMP5w/EA== X-Google-Smtp-Source: AGHT+IHTutiwgvGy1L98jdZRZUJYTKZGnd7We13UuO0JWnO3/681UUG4t6r51OfJ1MzGeR10Jmh1 X-Received: by 2002:a17:906:b858:b0:a59:a727:1e8b with SMTP id a640c23a62f3a-a5a2d53b02bmr665937866b.1.1715641419283; Mon, 13 May 2024 16:03:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715641419; cv=pass; d=google.com; s=arc-20160816; b=HyY1I7utpS9klhO0xJI2H1QtkLaIEHmZr8v/OYioy6UDMzvylFurRCffHUIsiQHbWC Z7RwBHaMzz0VMysVCKeyeo3P96y7g8Z1vI4Mcl+4Z+RzMsQEd4M8jw04wFzf/cploWnO o5ei24xK1efCEnBIqEIyGviFKUjx0D/LY0Q8oyIla++2VasQMNkhrQ4WQGge2BQ/Tcc0 Hu3bSOsNBBzv7p8OMwmXFcuSRPjqAaonZL45SnXWsbv9AkrmShvHz4yZdD1KqUMRj75W bS6nBNqQVq6KnqXHgXt/JJ5PFJwp52h0s2/46Sbj6KKKhSkYwzpMDWV1rm3+tPXpL4k9 ibLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eiIURfigbv4jfMYVn+cegJe5X/kgu+BloNveVda8Z54=; fh=eKcdwWNoV87TdncTp4PUOHVPEANRos3Ui7aShMN/Mvk=; b=cOYM9c6lHhKFYG/tM9GkU+jcrBEHFUwv3vtJ8h2qt3c6YonbQwfv9xJL/iEmi7nvuZ 5TUJ4vwpG1OF7tHVdLd/F1Uy0FlJVZJj8JeP+OgzNye7ptznLwc8PksNC0jAgonp5vRc JuUoUEn6kpjPJV5lnRs4IdDIKnbNdweTyf81VLWfhguj+xK/zLTB5oj313eUC6ZA5Tj1 7k0wtHhgiNuwmpEExWJjC/SO1Ga1rVcJRMzR4h4gez0bb3dDAEEpdujv0hKWMVoLfUlc RTysC0rzfYZZ3StSGnI33pznF4n3WT66odoTtZQ5vvi5jXkvprAklfN7sIhGhDXpxXCc xRrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=iKd+8fwn; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-178161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178161-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be645bsi533085866b.733.2024.05.13.16.03.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 16:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=iKd+8fwn; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-178161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178161-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0908F1F21DD3 for ; Mon, 13 May 2024 23:03:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A262D85275; Mon, 13 May 2024 23:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="iKd+8fwn" Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 7798084DF1 for ; Mon, 13 May 2024 23:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715641406; cv=none; b=KGClKSgZ7fsEDeoe2JKyAXgw/Ck1QsLoAXU/3Zgk7CXEn9pil+qcJ7dSe057RdwOG0YI66H8+GakfJ8xeyB4ScbEzGaoKj4C09G3mQ+nMxSxYLzKhD5FR4WS82TYe/xXVWeeoa/0G3TE4nbl9SLaSkWrKHNJabqoLiYfTK637Dk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715641406; c=relaxed/simple; bh=/9z5Va8BoS10Zw3lv3iW17W4Qhvjzu7IIUUc3s4u6+E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MxVtRZmu1cJvNhu/2InqZn45sH509Udh2teZAbcdUjxh1SNdTudzx4n1NbcD0bHDXeTpAQwseocYAXsNub8OZxzE+d7sUEAh2fFQLhnpYyfe8NRO5i4YGqNiIFhQCsZLcSTJIcL3Fl3jBcGxNUlBzPkQ1MR0w9q9DOSEoE9BTzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=iKd+8fwn; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6f490b5c23bso4168266b3a.3 for ; Mon, 13 May 2024 16:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1715641404; x=1716246204; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=eiIURfigbv4jfMYVn+cegJe5X/kgu+BloNveVda8Z54=; b=iKd+8fwngYQ1a9VzFZ1uGEVrJHwiOLeTu0PzsbV4jUJ3bNunb/Hrd+Ob/apHhpW9F1 PpcyDeGKKTuX8Lbk4hb1N8fYWGHFp+1iCvt0CyhdE9tdaQXsjtG0FFvDIhbHWsu/qMpI mJx6tYUMvvYeQwFfnDSL/KByxX7SdP9uHyOlVaXU1p2xFGcaTMInakp5Z9YwdclpkCsL vp8ZFSDahv/9sI/5ChJXUPBeS2g5a2ttW6IgLxquW0ahKsdBV0wo97d708G81TM5vp0D oncFWNnaT9SS/8tJqd018OMRbp+87vuaFtRFBHrDWi4BjiWVAulZ4HPrpxPyJoo1SpE1 Ay4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715641404; x=1716246204; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eiIURfigbv4jfMYVn+cegJe5X/kgu+BloNveVda8Z54=; b=wbymkt8PlhGxKjT2QBEfga2FFHVSorUbMk7OOpQo59LZ/3wc47TvYlgslkGnF/wG/X Du3vXzTHVZWHKj1gomWvVq6r10PUAfY9Nw0chna4AzVMPt1UmrTJ4brHW67tbXud151A cl2GZ6OlHlURT5IBCdHOoPwlSl0FcDfftaJVPFvqjCgaqHpCH18Fex/IrpngtcNb497l qA+qlHEJcx2LknGtsqZT9q8QuPJzppcfM9TEx4fnIKeT6V93dsmpPyRI5JoBZzL3G+DX U0nXCKvqlG1T2vDfZi2iIV6AauMAyqw1WlhmvgpfFnehfVvj0RtfUQtvH1L2vRlsYCrm eFYA== X-Forwarded-Encrypted: i=1; AJvYcCXLiDH7rs7Mv/ReYEVLLUcPzyt2fzabyb9SagqxOUhu4mGdjx/OCHIqc64XCejiBI/H2tFCgixosZmv2XrumWy6A4sCQO0osa5mKjp+ X-Gm-Message-State: AOJu0Yz7KWpjutztCOXQiUoQEWMyu3wQxHYodTU2GDTAfUAblfx5eBQm wPf8nF4tjt6628bAdSbHnGogLmvS0ZkLuvMI6D4AY2z7Ns1er6zbsVuvCRWGbaE= X-Received: by 2002:a05:6a21:6da1:b0:1a9:5e1f:8485 with SMTP id adf61e73a8af0-1afde1180a2mr10908731637.31.1715641403754; Mon, 13 May 2024 16:03:23 -0700 (PDT) Received: from ziepe.ca ([50.204.89.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2a665c0sm7877475b3a.3.2024.05.13.16.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 16:03:22 -0700 (PDT) Received: from jgg by jggl with local (Exim 4.95) (envelope-from ) id 1s6ehW-0001ej-5J; Mon, 13 May 2024 20:03:22 -0300 Date: Mon, 13 May 2024 20:03:22 -0300 From: Jason Gunthorpe To: =?utf-8?B?SMOla29u?= Bugge Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, rds-devel@oss.oracle.com, Leon Romanovsky , Saeed Mahameed , Tariq Toukan , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Tejun Heo , Lai Jiangshan , Allison Henderson , Manjunath Patil , Mark Zhang , Chuck Lever , Shiraz Saleem , Yang Li Subject: Re: [PATCH 0/6] rds: rdma: Add ability to force GFP_NOIO Message-ID: References: <20240513125346.764076-1-haakon.bugge@oracle.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240513125346.764076-1-haakon.bugge@oracle.com> On Mon, May 13, 2024 at 02:53:40PM +0200, HÃ¥kon Bugge wrote: > This series enables RDS and the RDMA stack to be used as a block I/O > device. This to support a filesystem on top of a raw block device > which uses RDS and the RDMA stack as the network transport layer. > > Under intense memory pressure, we get memory reclaims. Assume the > filesystem reclaims memory, goes to the raw block device, which calls > into RDS, which calls the RDMA stack. Now, if regular GFP_KERNEL > allocations in RDS or the RDMA stack require reclaims to be fulfilled, > we end up in a circular dependency. > > We break this circular dependency by: > > 1. Force all allocations in RDS and the relevant RDMA stack to use > GFP_NOIO, by means of a parenthetic use of > memalloc_noio_{save,restore} on all relevant entry points. I didn't see an obvious explanation why each of these changes was necessary. I expected this: > 2. Make sure work-queues inherits current->flags > wrt. PF_MEMALLOC_{NOIO,NOFS}, such that work executed on the > work-queue inherits the same flag(s). To broadly capture everything and understood this was the general plan from the MM side instead of direct annotation? So, can you explain in each case why it needs an explicit change? And further, is there any validation of this? There is some lockdep tracking of reclaim, I feel like it should be more robustly hooked up in RDMA if we expect this to really work.. Jason