From patchwork Thu Dec 15 18:41:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 33790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp539639wrn; Thu, 15 Dec 2022 10:48:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gSbI7AZTtY0VCXCKIf8uOqtj3LceJRPAMZrOJDHKserU9Fa31yuvUGW0ZnriEvQK98m1/ X-Received: by 2002:a05:6402:25c3:b0:460:811d:8a12 with SMTP id x3-20020a05640225c300b00460811d8a12mr25589985edb.20.1671130083584; Thu, 15 Dec 2022 10:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671130083; cv=none; d=google.com; s=arc-20160816; b=vASAOVquBaCms8ZiZLYuQcebk8L/jBd91bGRDWLD1UAO9goyKiHbbhCFC/XjM7JbXS gl0aV0AAM8JDOx0WJmeRP0rnuo8Qk+3AhvDUsgl8MnJ1+aUyvoP3VwriuBJRiqSmD8YR bKxfnlzahvnKQBhl+oeJH4uoc6uEPFMqiUBY/b4OBvQHsMTvfWKUxXo9/Slj3Tr0d5eT 2a2Ol7d5cBoZxzpO0qx9ZzM0dAdAtV9bdHdEhGzF0QGF41nDTgtB6S4ApngM5uUcZZtq 3vdjQ4d4bwkUYYjkpfT5KTOofiPmU0S8oOBXHTJa7PShAadPi6R+5zmnJEOq6aUZusLf v3dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=twW8lkEp2/M4gTKzdGhwZNpy0DBsCC2x+xCTF+N9dWs=; b=OUVoIP+ifRq5QubUr+eLp5sk5PqHpKuJup80kulUf+XjCYuUP8rcgMGYcuhmtKXjSz Jh88SAkE7zxTgkXSGOMvEW63PpE40MyZy0bgXxdprq93pNXpYNFIRKwJsVe9slwjazSI aiIMnax2ntgXKcgfW6nXmu4r4tiDsSL6b2D3Xq95wPhsUJVm9K7wR3JznjavI6j7QK8P tC+On6AHVid9EsfFZRdz8zPl4B4N6noyhnc7t5LyU6g3JjaYijvHFTxMsowxFnY7ATXA M21RKhLwhsmD9rBJNx9fn4ZvzJd0aA1Y8YyxHFpxZn+JhCR1hAptkAzEtw057lvazm3y DbJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=Tuwg2vrc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e21-20020a50a695000000b0046775f92f19si73298edc.50.2022.12.15.10.47.40; Thu, 15 Dec 2022 10:48:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=Tuwg2vrc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbiLOSl5 (ORCPT + 99 others); Thu, 15 Dec 2022 13:41:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229883AbiLOSlz (ORCPT ); Thu, 15 Dec 2022 13:41:55 -0500 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 517F7DF7E for ; Thu, 15 Dec 2022 10:41:55 -0800 (PST) Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BFITwk8003849 for ; Thu, 15 Dec 2022 10:41:55 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=twW8lkEp2/M4gTKzdGhwZNpy0DBsCC2x+xCTF+N9dWs=; b=Tuwg2vrcy+93D/DO/OWQXPY6XAm6RuaKYFswpBH1jFfpIR8YhyU1tIaxzonAbllyLWPW cppL6uPnqQxzIqLZ4NRQ0hCBR5qBqR8UO00hnr78KT+cm9TTmxhBBZKfJ0elrmf3uDzQ yvwCgOqEFRl6CMNE4no6FrNsvOV87B/oS2KYUwmgnlM3hqNM88CrUtHmZspvxiNNgj8o CGmY7zlU+UyjWZkFAAatmg1roHmcxTNtQ7SAVDfg4WXDqKi6uSB4cUD0HhvQjrxJ5In7 6n0faJ16M4JkB0e/ZWP71XwejzYgAfHwRJY5HQ56YQe2gVwQ2PlW3dVtlhNXXIMw8VF4 vw== Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3mfvchw5b0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 15 Dec 2022 10:41:55 -0800 Received: from twshared2003.08.ash9.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::d) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 10:41:52 -0800 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 8FFD9B73E148; Thu, 15 Dec 2022 10:41:45 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , , Dylan Yudaken , Joel Fernandes , "Paul E . McKenney" Subject: [PATCH] io_uring: use call_rcu_hurry if signaling an eventfd Date: Thu, 15 Dec 2022 10:41:38 -0800 Message-ID: <20221215184138.795576-1-dylany@meta.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: k2QgBx1TIFqxc51OqiW5dxvXQ1OEHL8f X-Proofpoint-GUID: k2QgBx1TIFqxc51OqiW5dxvXQ1OEHL8f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-15_11,2022-12-15_02,2022-06-22_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752306898446321733?= X-GMAIL-MSGID: =?utf-8?q?1752306898446321733?= io_uring uses call_rcu in the case it needs to signal an eventfd as a result of an eventfd signal, since recursing eventfd signals are not allowed. This should be calling the new call_rcu_hurry API to not delay the signal. Signed-off-by: Dylan Yudaken Cc: Joel Fernandes (Google) Cc: Paul E. McKenney Acked-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 041fae9c105ae342a4245cf1e0dc56a23fbb9d3c diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index b521186efa5c..2cb8c665bab1 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -538,7 +538,7 @@ static void io_eventfd_signal(struct io_ring_ctx *ctx) } else { atomic_inc(&ev_fd->refs); if (!atomic_fetch_or(BIT(IO_EVENTFD_OP_SIGNAL_BIT), &ev_fd->ops)) - call_rcu(&ev_fd->rcu, io_eventfd_ops); + call_rcu_hurry(&ev_fd->rcu, io_eventfd_ops); else atomic_dec(&ev_fd->refs); }