From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCEA8C00140 for ; Mon, 15 Aug 2022 23:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345730AbiHOXMD (ORCPT ); Mon, 15 Aug 2022 19:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353162AbiHOXK6 (ORCPT ); Mon, 15 Aug 2022 19:10:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10670144E0D; Mon, 15 Aug 2022 13:00:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 363F261226; Mon, 15 Aug 2022 20:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BFD3C433C1; Mon, 15 Aug 2022 20:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593607; bh=q7HeBn6uyB5qIMUcOE0UZOInjM7NHBYSfG82jh+373g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENYNfEJYtewKl52hFCWiIAUHLe+tqFha4siR75V2csSFGVv00gyDdZifjMg+N6UDv ROXcrqI3BotwkR24BMPnSMhAv9GebGS5yCt5rt/ZPGnZLoPS+e9VJ8+3hyNbNr/ut5 snoaF+1t8GnwVXb8/D26EriBv/DLSLi6na7f/G48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Michal=20Koutn=C3=BD?= , Roman Gushchin , Jens Axboe , Sasha Levin Subject: [PATCH 5.19 0295/1157] io_uring: Dont require reinitable percpu_ref Date: Mon, 15 Aug 2022 19:54:11 +0200 Message-Id: <20220815180451.432936539@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Koutný [ Upstream commit 48904229928d941ce1db181b991948387ab463cd ] The commit 8bb649ee1da3 ("io_uring: remove ring quiesce for io_uring_register") removed the worklow relying on reinit/resurrection of the percpu_ref, hence, initialization with that requested is a relic. This is based on code review, this causes no real bug (and theoretically can't). Technically it's a revert of commit 214828962dea ("io_uring: initialize percpu refcounters using PERCU_REF_ALLOW_REINIT") but since the flag omission is now justified, I'm not making this a revert. Fixes: 8bb649ee1da3 ("io_uring: remove ring quiesce for io_uring_register") Signed-off-by: Michal Koutný Acked-by: Roman Gushchin Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index f429b68d1fc2..27ce532c6c8d 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1701,7 +1701,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p) ctx->dummy_ubuf->ubuf = -1UL; if (percpu_ref_init(&ctx->refs, io_ring_ctx_ref_free, - PERCPU_REF_ALLOW_REINIT, GFP_KERNEL)) + 0, GFP_KERNEL)) goto err; ctx->flags = p->flags; -- 2.35.1