Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp45345lqo; Wed, 15 May 2024 07:20:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBGgYZf7+a8MktChpw0CvXZABjgTH4o+EihoEs+AO7iBJfDS/ciTlmiM1FgHNV/tZwd3A8mJRNij2wa+CsP2KXzce+5nhbkXWVtd7rWQ== X-Google-Smtp-Source: AGHT+IH07VhQKrSShecRnudxXI7tWI1fg592lSTCZnKk5imYqzghFkWFUQnY3nr/Bjesn4NVa89h X-Received: by 2002:a05:6808:4184:b0:3c9:932e:5b88 with SMTP id 5614622812f47-3c99704c1d3mr15534438b6e.14.1715782799620; Wed, 15 May 2024 07:19:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715782799; cv=pass; d=google.com; s=arc-20160816; b=plN4j3oDkbkDeLlz67g2DCvVsqq5+P3QviIm/Tf7V5c7WwND2TvpnAh5W8dHU6VdDF mx2yq5hoPNBGIpIQNG4tVbOsYtnALbMCgB62RVxjdWG7ocLEeS81qMAMzPVZBASU2XdS wizhvncuwuxYP1J2b1m5B6XNvMd2rSWDRhpsAn00sWbDQDvNnFpV9hFRutZCRMR1GdOR cFai7nW2neLCevh3tcIHthtFnvbCsEpv0s1V9fO3GGOVKOA7AUkjIhA706nwUOrMRVot STs2Uaw4YSHfUHms0SZn1lQL0qDs7KvQFaLL5ypg+c/P0JvjKp5252Z3859Rytq1j8OV 5VzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=uCYHK17hrJDOfXBR96uhZxWSEWnjI89SyGP2oY566u4=; fh=GaSAYfh5FLoTC6t2Xhg6bNmq0NjRUvBIE2VOTI0dJc4=; b=D+f8CZ5YnXcJ6b65hey6VTlMZxC8mbuxt6+/oL5ObvC8cIAqAuBN82bQbbbNQ0XP2r 1GxdBW9cAvnRB5uGZYi55mY3USR3AmMALAseDREZ2Pyhd24ZSdxxV/qVFCcfSm4/peJu IwCtu0UKn9tCiajYTllp+9tC0r3cS/KZgfEXtJ9x6RIKt0NsvH7qj9pVHuGXMSnEnJaA c2YK6PlHqT0/VClWi35wsOC+I12rPqGVxG3zhyeKmAtDH2PvYSN/Gl3Y8sRqtvgwUeUe nuCOCi7UT8D+burX0hSdwhby3Vg18O2EMzJD3n5Sr7BrWHGcNqJWIF/Z1DADccGhFiAp lvcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=INEPCQmx; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-179982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf365109si1536949485a.574.2024.05.15.07.19.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 07:19:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=INEPCQmx; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-179982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com 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 58EFA1C20DE0 for ; Wed, 15 May 2024 14:19:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DB9E13FD63; Wed, 15 May 2024 14:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="INEPCQmx" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 C2AA913F43D; Wed, 15 May 2024 14:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715782787; cv=none; b=X0DZWsHnzDnICUSfW03QNWnl7gB2UFnNm+tzHR4TuGYe6CtEoogDTYXHu8Q+EjFKovpm/IAZEKtZXCmSkp8lqgqDH53GiWzjLZ4c6FnN/UnjMqmK1V6AUNeWhP0ZfkwLGIvJPBhGmHl04mcTbyMJcI1zpw1m6O1WCVaHsiehvlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715782787; c=relaxed/simple; bh=e+p8RDk6UwCW/o9hvuO0idARqRopXax2P77SzHlLk1g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=II4DrTic6Z/EYda95fl52PbPhinqkYHfZ/dmXDB2je5I0KPIEkAOmh2YHt5wsv5P/zOnbs7vrZePVzdhsSBJ3y5YmQhbRFhbwmRP4fZekYUxQjmI3xW8fuZtz4HCEh2OoHDQ7UJWwm3GKzxzV6ygT6304stST3NgwyAxYDbxiMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=INEPCQmx; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44F7nnaT008005; Wed, 15 May 2024 12:53:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2023-11-20; bh=uCYHK17hrJDOfXBR96uhZxWSEWnjI89SyGP2oY566u4=; b=INEPCQmxH/ndA0QPvint7zqkUM0BXXaa/DAo/6BOkmwm/B47MYt+xft2oqKQeiNxHxUe XSDtnfreq8R2lJpYMFAVwX34WAl1rnR21JZT+16Wem4QHqteSHuTBkejE65EzK5HcmeA Vhd23WTnUe1voEEZSGrC7uoyllBqi890u271pR6ZPUfeQzcv4L/Vi/vbWdZpQvbLpgXH j2JAisKK0CaQsVXsjlVsn7CGVpxt315KZ95jO6QB5F07+eG5X9wdyNZ7cPT8tJF8WNVj h2gdFQPpQo6jwXefKtXzcx6zcbCtSVz8A5Xzd18xlumLRcWnef6gkn0JOwU3Wy7iVM2g cQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y3txc2xxf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2024 12:53:49 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44FC60pr038324; Wed, 15 May 2024 12:53:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3y24pxgugg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2024 12:53:48 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44FCmlrX038458; Wed, 15 May 2024 12:53:47 GMT Received: from lab61.no.oracle.com (lab61.no.oracle.com [10.172.144.82]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3y24pxgud9-1; Wed, 15 May 2024 12:53:47 +0000 From: =?UTF-8?q?H=C3=A5kon=20Bugge?= To: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, rds-devel@oss.oracle.com Cc: Jason Gunthorpe , 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 , =?UTF-8?q?H=C3=A5kon=20Bugge?= , Chuck Lever , Shiraz Saleem , Yang Li Subject: [PATCH v2 0/6] rds: rdma: Add ability to force GFP_NOIO Date: Wed, 15 May 2024 14:53:36 +0200 Message-Id: <20240515125342.1069999-1-haakon.bugge@oracle.com> X-Mailer: git-send-email 2.39.3 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-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-15_06,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405150090 X-Proofpoint-GUID: 0CdHtR4Rw4q5f5UdYabwerpWAtTHmgJV X-Proofpoint-ORIG-GUID: 0CdHtR4Rw4q5f5UdYabwerpWAtTHmgJV 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. 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). HÃ¥kon Bugge (6): workqueue: Inherit NOIO and NOFS alloc flags rds: Brute force GFP_NOIO RDMA/cma: Brute force GFP_NOIO RDMA/cm: Brute force GFP_NOIO RDMA/mlx5: Brute force GFP_NOIO net/mlx5: Brute force GFP_NOIO drivers/infiniband/core/cm.c | 15 ++++- drivers/infiniband/core/cma.c | 20 ++++++- drivers/infiniband/hw/mlx5/main.c | 22 +++++-- .../net/ethernet/mellanox/mlx5/core/main.c | 14 ++++- include/linux/workqueue.h | 2 + kernel/workqueue.c | 21 +++++++ net/rds/af_rds.c | 59 ++++++++++++++++++- 7 files changed, 141 insertions(+), 12 deletions(-) -- 2.45.0