From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_SOFTFAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6709C433EF for ; Fri, 10 Jun 2022 15:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbiFJPpe (ORCPT ); Fri, 10 Jun 2022 11:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242198AbiFJPpe (ORCPT ); Fri, 10 Jun 2022 11:45:34 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE1AF419BD for ; Fri, 10 Jun 2022 08:45:30 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1654875928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=htici5IhCco8uUoqxEaCGM1HcOK8krzc7QcUYVu2RqI=; b=PO2tvmOQMwwOT7c5z0+ROWvZX2Q4OYNul1jT5JY1OuXJI7vCd+5Z6RyUsM+Ar5425/BPQW E/6jKa6a+mHdlfhXOKZqF1TvqsFkNVYOmJdpEWF3nci9ONMKZ7Buo4V0tJbCrhmhzfw8Bu KnDjc3SQFwXNMpwoMut89NJYPEe7Sg4= Date: Fri, 10 Jun 2022 23:45:20 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v3] io_uring: switch cancel_hash to use per entry spinlock Content-Language: en-US To: Pavel Begunkov , io-uring@vger.kernel.org Cc: Jens Axboe References: <20220608111259.659536-1-hao.xu@linux.dev> <37d73555-197b-29e1-d2cc-b7313501a394@gmail.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Xu In-Reply-To: <37d73555-197b-29e1-d2cc-b7313501a394@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org > The problem here is that after you unlock, nothing keeps the > request alive. Before it was more like > > lock(completion_lock); > req = poll_find(); > cancel_poll(req); > unlock(completion_lock); > > and was relying on all of this happening under ->completion_lock. > Now following io_poll_disarm() and/or io_poll_cancel_req() race. > Same with io_poll_file_find(). Looks we have to add completion_lock back for cancellation path. > > Should be fine apart from this >