Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 34386267B04; Mon, 12 May 2025 09:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747042071; cv=none; b=GQi5QwXb1G0hxKVYrD6QUq1j8cwz8OV4r9vrkTiPK5HjQ5n+aTWNmeEredvvZKLwbublYljNLA5HX1c7Fi2JcmrvIxnHbK7TJY9e9Z3jpyT31fvQoXSPsBg0bguzZWsBli9aDMDC0z5JdMLSqhXnuTiIYvdmZhhUHiG71o4WpQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747042071; c=relaxed/simple; bh=jOJA68RRCsFupoKbIXpdPkdpTgYXhITPGS5zLjDwJlw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=giTmn+f/fqv7W2rqZ0I/+syr/MJ/DR/V64KqvbY0TQ3BvsdMR2q8U9eREu2FtFVjsVkdcztFwhhr4adxRtnDSREuGjwmKNPlm0ZC7LzpZ7L6pwruBTr3LQgeSaXTHLPejmWZqsEw35gI7B5QVnNZxxFkmzSLhYdO2zSG7MynkM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tihqNMiV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=r3Dom5kl; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tihqNMiV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="r3Dom5kl" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1747042067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QW4ASRASgx99S0FnlTl8xeHoYCpECC/wdaoXtQZvpSA=; b=tihqNMiV3HwTpJH2ATdT4yNwRWfHsbCiFGfJVC5jDHkLGoNwNjS1fcXRnNxxLGeb5uk/fU VI2/dyDTTaV4dxwPxFqxtiF9MU+fHeQkTqWQ1mZjuCRvJ2TyOOw/4tmwm4CYDl35bVAuUr Q6SlACk88pibS8UwWzYORmgPrNV0GN1eHn95bbeRcMLU+z2D5y72fPZJUZPAu48U8fq9rr HoimwPKQ7mlnv7NOEK8mXTgsEcqy1skziOWKsQTuPmXhg+cWjPivUOjIHbeZYS9T07JDuj rjxgzaLIexwj2rCZ9a3gKB6w7d0ccnvyVrZwrr83srHYhLWy5OBWewwukE3wwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1747042067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QW4ASRASgx99S0FnlTl8xeHoYCpECC/wdaoXtQZvpSA=; b=r3Dom5klltEdw93cM6xYV/3G/n2YWdUCXITg8Tkh9WahQPFhoJVOPJcH8Mggta1p45x/V4 MECcw3r5z1gugXDg== To: netdev@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Thomas Gleixner , Sebastian Andrzej Siewior , Allison Henderson , linux-rdma@vger.kernel.org Subject: [PATCH net-next v4 13/15] rds: Disable only bottom halves in rds_page_remainder_alloc() Date: Mon, 12 May 2025 11:27:34 +0200 Message-ID: <20250512092736.229935-14-bigeasy@linutronix.de> In-Reply-To: <20250512092736.229935-1-bigeasy@linutronix.de> References: <20250512092736.229935-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable rds_page_remainder_alloc() is invoked from a preemptible context or a tasklet. There is no need to disable interrupts for locking. Use local_bh_disable() instead of local_irq_save() for locking. Cc: Allison Henderson Cc: linux-rdma@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- net/rds/page.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/rds/page.c b/net/rds/page.c index 7cc57e098ddb9..e0dd4f62ea47a 100644 --- a/net/rds/page.c +++ b/net/rds/page.c @@ -69,7 +69,6 @@ int rds_page_remainder_alloc(struct scatterlist *scat, un= signed long bytes, gfp_t gfp) { struct rds_page_remainder *rem; - unsigned long flags; struct page *page; int ret; =20 @@ -88,7 +87,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, un= signed long bytes, } =20 rem =3D &per_cpu(rds_page_remainders, get_cpu()); - local_irq_save(flags); + local_bh_disable(); =20 while (1) { /* avoid a tiny region getting stuck by tossing it */ @@ -116,13 +115,13 @@ int rds_page_remainder_alloc(struct scatterlist *scat= , unsigned long bytes, } =20 /* alloc if there is nothing for us to use */ - local_irq_restore(flags); + local_bh_enable(); put_cpu(); =20 page =3D alloc_page(gfp); =20 rem =3D &per_cpu(rds_page_remainders, get_cpu()); - local_irq_save(flags); + local_bh_disable(); =20 if (!page) { ret =3D -ENOMEM; @@ -140,7 +139,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, = unsigned long bytes, rem->r_offset =3D 0; } =20 - local_irq_restore(flags); + local_bh_enable(); put_cpu(); out: rdsdebug("bytes %lu ret %d %p %u %u\n", bytes, ret, --=20 2.49.0