Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1204881pxb; Sun, 21 Feb 2021 16:07:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaGnFEste89j5KBnwfG5i12LO97Q/Zsq1/F0yigPJHLZ1CR8f5qGxuiJbvuFtql3pz/CXn X-Received: by 2002:a17:906:6095:: with SMTP id t21mr18533571ejj.384.1613952467264; Sun, 21 Feb 2021 16:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613952467; cv=none; d=google.com; s=arc-20160816; b=NLpRHyE4xQlR2yOJZETlnYcC9g57LdlgkNulKsFPhoAwn2BpXwnF0ttq1q1W58gSUx T2i+OnJal6xxfkUnS7Jj203BgB+AwOcD286V5ig3iXKdJipHSehQ0SsFYRj1WC8d8GQs NtPDgRua/wuW0sHvnpGV2E6qwNwARc2hk8Q2wNtPCJ+nkx3ln074IzW9GjgAPDWVWif5 ZXDGXAkks9S5yGIQfbWFSKWGWrpQcd0wxgOmw8fD/qLpZTxUz66hTzkOTMZkcvFYdX8l pWSZsle2Nl6CDg1rHX43gQgSt6njTMBCPIiKcanW4tAL1dBJhuVanfB5Je44vfJRRh1M ZZmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ewxqEQFZCqRPZepFJZrArWqJzNzRyrMy8DlI7kZWdbY=; b=mmfOF4ZqVxNmUu9KoMjCoDgPoyKsBY36jWLGPnBF8t1cDAMX5y9r5ezC31eduHWIsB soncBloAEhgHgsEA4iyqaX4QAchhKaCqBa/y4hIl6qe1wYynFKbz60v0UG5GuJWhAPCY 5nD3cCEdYqkT7FMSOE8db50AiiTuXIU19SG68V0ZjJoYC1MjUtQlFSZpS/i1e/k0DygN ikofeex4l3/Vkik8U159+LDAsSsrks+UZ58uCzFvbSPXvryQADmAwtFnBOAHPRVuIfMp AXEHzaPMyuy/1NQE4tLjokORwB8KIU5jKDw6rj0frCuriDGViD5YLFb3msZiA3lPltvX 7kug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=tBabDsQM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si10594841ejy.52.2021.02.21.16.07.02; Sun, 21 Feb 2021 16:07:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=tBabDsQM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234105AbhBUXi4 (ORCPT + 99 others); Sun, 21 Feb 2021 18:38:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232151AbhBUXiz (ORCPT ); Sun, 21 Feb 2021 18:38:55 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EFF5C061574 for ; Sun, 21 Feb 2021 15:38:15 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id t26so9150798pgv.3 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=IRaaElX4TjwXkGFFtab/L1LEDeamjhfw/5txgHc5h7dpQWZyKIwiQo5sB4KF7G6nNT vDGSeUrw0MXo5YyVUUMJvROJli/PzS2J1DTaTjTbJbm8YJfLRGf01cu0paj/TF1mgR6H vFCjbZH7mNJspsGluNI9VW3bsdxSFn5+ae8fRKoc3UPLioQvtZ3n7ZENxAHdtIdac+Bj Yl9Lxvq1Bye2quE0raLPgsLsJLMVvQhBxp+S3FQdtjgMSxPLjU3Izi8gyN0f92a5RaI+ Inz7Fuxdlsz8Ph7QmMJLUyubuVTHe4+K4lY3XANJKAtCFqsLpzXhE9oN8WWLbZkfGiI7 RG8Q== X-Gm-Message-State: AOAM530AuYRqWMwrOG2M2IfZzBL0PIeSx2lAf7le0zcTghkI8I7x205z fexUPTAlkBkBlTDf+rbErn29aQ== 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: linux-kernel@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