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=-10.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 28E9BC433DB for ; Sun, 21 Feb 2021 23:39:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC1606148E for ; Sun, 21 Feb 2021 23:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234161AbhBUXiz (ORCPT ); Sun, 21 Feb 2021 18:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234105AbhBUXiz (ORCPT ); Sun, 21 Feb 2021 18:38:55 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BC5C061786 for ; Sun, 21 Feb 2021 15:38:15 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id 23so1011731pgg.4 for ; Sun, 21 Feb 2021 15:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ewxqEQFZCqRPZepFJZrArWqJzNzRyrMy8DlI7kZWdbY=; b=tBabDsQM88C48+TrDFasmGxRf9lo5KwLdwTxTlg6mOAIgYZzAu1QYqLxKOml6fQOpU sRCdc7uSzDIWN6ysldM0C5UOcR78C8eihFm52FXeZeU+HQ4csvIauJLeaLgfzaUJ8Qnr 5JJNoaB/g4w2yfmgFyCLRE7Ps4aKp6JA1lhrUFiAc2A2JIjLe+3z1R0c/lJrPe9Ll3N/ J2mJXNLavJiiqF/v9E+t0MVLpwv3xigXA33nIZlLGhFCGxR2J11FiNfdpT0diMrfrxQE imsmjKZfRkFo6vfVn41CuIorDhu+QEmQ3y9hFxktPLlCaY0wJ8AWWG96mxJpPBkj7MRL K8wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ewxqEQFZCqRPZepFJZrArWqJzNzRyrMy8DlI7kZWdbY=; b=gkpIHdMzmeKO/XLdLaqZDaT7G4PQ9wW3g3j9wdPcUvPDNBH+VGezOtSpUIrsddayq5 B+7LRJWlEKPFfXVyZh3nsb44qIVKaGrklrjKjQc6AfRXzriQWUiy+swBwGxptwKbv3V/ MdEmGcKc/Tv6TZQoW5EX9/zIMJVbIsHSHwJpAHHJ7hpf3pq5NbOaZfXsJ06rlm1qurQN HybqxkVjFQ92MPuU7cf3eBVPa+02ZT6sS0GLYGxQWWwczQ/iH96dQQodZXaAKR68Zp5X Ju6jSnu3ZEcWpYF8sP4GEukRRHYSox2VahdVpZyUY/+ZGQtqcJnCZH3GeKPTUJ0IdGwT Ik5Q== X-Gm-Message-State: AOAM532ij2FSYlEXu7LRcYZ4uUgByaBUeTZ2NFQcP7xyUmdUetXCROvz WyTmPpRSYnqwOn9KdEpn+8gi4A== X-Google-Smtp-Source: ABdhPJzdBl7iEW57AktQz1trvZZaWXb2g0jBAcCa1BGnJzyovv2hB07dcYLx+z1UHy8R8jqqeRueQA== X-Received: by 2002:a63:c042:: with SMTP id z2mr17881788pgi.201.1613950692408; Sun, 21 Feb 2021 15:38:12 -0800 (PST) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id h20sm15842126pfv.164.2021.02.21.15.38.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Feb 2021 15:38:11 -0800 (PST) Subject: Re: [PATCH v6 3/7] Reimplement RLIMIT_NPROC on top of ucounts To: Alexey Gladkov , LKML , io-uring@vger.kernel.org, Kernel Hardening , Linux Containers , linux-mm@kvack.org Cc: Alexey Gladkov , Andrew Morton , Christian Brauner , "Eric W . Biederman" , Jann Horn , Kees Cook , Linus Torvalds , Oleg Nesterov References: <72fdcd154bec7e0dfad090f1af65ddac1e767451.1613392826.git.gladkov.alexey@gmail.com> From: Jens Axboe Message-ID: <72214339-57fc-e47f-bb57-d1b39c69e38e@kernel.dk> Date: Sun, 21 Feb 2021 16:38:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <72fdcd154bec7e0dfad090f1af65ddac1e767451.1613392826.git.gladkov.alexey@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 2/15/21 5:41 AM, Alexey Gladkov wrote: > diff --git a/fs/io-wq.c b/fs/io-wq.c > index a564f36e260c..5b6940c90c61 100644 > --- a/fs/io-wq.c > +++ b/fs/io-wq.c > @@ -1090,10 +1091,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) > wqe->node = alloc_node; > wqe->acct[IO_WQ_ACCT_BOUND].max_workers = bounded; > atomic_set(&wqe->acct[IO_WQ_ACCT_BOUND].nr_running, 0); > - if (wq->user) { > - wqe->acct[IO_WQ_ACCT_UNBOUND].max_workers = > - task_rlimit(current, RLIMIT_NPROC); > - } > + wqe->acct[IO_WQ_ACCT_UNBOUND].max_workers = task_rlimit(current, RLIMIT_NPROC); This doesn't look like an equivalent transformation. But that may be moot if we merge the io_uring-worker.v3 series, as then you would not have to touch io-wq at all. -- Jens Axboe