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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DDA4C433DF for ; Mon, 15 Jun 2020 15:04:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 259232063A for ; Mon, 15 Jun 2020 15:04:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="eaM7SmlS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730860AbgFOPET (ORCPT ); Mon, 15 Jun 2020 11:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbgFOPET (ORCPT ); Mon, 15 Jun 2020 11:04:19 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB524C061A0E for ; Mon, 15 Jun 2020 08:04:18 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id i12so6948345pju.3 for ; Mon, 15 Jun 2020 08:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=cZpiXSF12XfOjR7Rqd/jEt2LEGNKKJL/5+ZFRXFRJD0=; b=eaM7SmlSIbbYYwLlQKQKN3s1VXlgvV97QWt2VnV5p4/rcL2a6keGKOmZZerVKHI+40 jXEPO1qVaiv5m+SXHbwhiH/PxaBUvSRXcYFvROAK3+px3uBwD5dUDIhjSChledyp5HQB pre1jYyts1p/ly8H4Q3OUKwO0r5kMDzrwmD6jsnM+GHGxbVHpmeTnxbjjxnc3rY4dioj kuhsgqeRwkAA+x3SVNk1bn4z7+pGD+1B0GulslAa29viVuIvdRf/TahUzErMnPjqghTP vzMyWBZMlZ9hc4PzrOHP3JUE9Ib1iJF5h6H1M5DRLwpF5zTxGXdVFe9CeGp4WGr7vYe+ FoTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cZpiXSF12XfOjR7Rqd/jEt2LEGNKKJL/5+ZFRXFRJD0=; b=clf/nIDIJfPKrMeyEgiClL2ex0OWwGVWW+D1QSE5b7OuPCsRcZsOpVsPieUpvbFdXB uu3QoXGaRXDQ/7bU5SUK8Uh2XgkC6coFl3ngZHkg0TN/oyicTLIWVFgvHlJrJtQoZ1m1 fdVCZfIDes9fbruEzbbyEwQ6UViLAEly9INOuJ5bZ/PwO+Eju6AKS2tm8FRh7anxQexH CbNDcCThmtCBWihdIPc+l343MhA1tA2sUl7xl7rA3xPi551AILE4cTEVnBY+wVovG3eg 4Ndx9NmopiLJTR3yrAKkLtBMWKXj7ChDOCtDEoqDhzyS7J6ffafIpM6vfHNnHAYU/amF lJ5w== X-Gm-Message-State: AOAM531e2IQEg3JkfjQeEiVQrB3rh7PDKPnzpoPEBvOYlqYP6DqX2IkE bd0Leiy41wpwtI6BCj81EkZKKQ== X-Google-Smtp-Source: ABdhPJyKaUj8lcGi70+zg9pMMQVi3VGnHiJAEoah7XZguN/TFcAWMF2yXVUmShZS3GGkR41IjANMGg== X-Received: by 2002:a17:902:b787:: with SMTP id e7mr11733374pls.277.1592233458327; Mon, 15 Jun 2020 08:04:18 -0700 (PDT) Received: from [192.168.1.188] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id u7sm14621286pfu.162.2020.06.15.08.04.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2020 08:04:17 -0700 (PDT) Subject: Re: [PATCH v2 0/4][RESEND] cancel all reqs of an exiting task To: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Jens Axboe Message-ID: <8033114e-069d-e8d0-f476-1f4d4bed3e25@kernel.dk> Date: Mon, 15 Jun 2020 09:04:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 6/15/20 1:24 AM, Pavel Begunkov wrote: > io_uring_flush() { > ... > if (fatal_signal_pending(current) || (current->flags & PF_EXITING)) > io_wq_cancel_pid(ctx->io_wq, task_pid_vnr(current)); > } > > This cancels only the first matched request. The pathset is mainly > about fixing that. [1,2] are preps, [3/4] is the fix. > > The [4/4] tries to improve the worst case for io_uring_cancel_files(), > that's when they are a lot of inflights with ->files. Instead of doing > {kill(); wait();} one by one, it cancels all of them at once. Applied, thanks. -- Jens Axboe