Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1702575pxb; Mon, 13 Sep 2021 03:42:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7YkTUhYgGVDhVq5qqblNNF/uVRuhFYIDmcfbQ1VNViCabALfFzeKos1iYVRjSAfTNDPsw X-Received: by 2002:a05:6638:1491:: with SMTP id j17mr8938805jak.75.1631529732516; Mon, 13 Sep 2021 03:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631529732; cv=none; d=google.com; s=arc-20160816; b=gy0Irkad+lAyASdRy2SForWs86ntI6cudmVo0Bn2GZhTVJAe+eZ47reFbPqpDJ5UTS igP+slyYwhJ94JLOE0UGW1qy80K69CE7g0ULSR2pT5cIULRTBDB+R9OOZhxEYX/QJQRw mw7gmhFJvhK/xwuRTBPAWIWNkJCu91Qq7MPLwBKAPLbrDUEm5O3CM+VSYpperQyO8KRt X/8MN4TpENR56egitkLw+7myrlH7G+YvGtiwVz92BQXcseg9xZeyCdiKQSWUdcnmehfg IrzHoEaDJ93ooO7fPvb+vcfo60mgSIvKwpLqT6UwcNof/lU9ySWEySBM/aR54qBVbe3Z twUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=ryXldKXp5w2qrYfIRmnB0eY0iF5R48B4/QR1QYkEKSY=; b=0nxfD61gC3vVwPvhaTI6f8lUjJyqMuoPDu61QeF+STgr3KQ7fdFBTzvs2Sc9uhkQzk EMJLhi8qr6gidaGMfIkwWg76K9J4iiXzolTJQOinSiyHcGK38nXrciQ6Ad+KjG5fG0Ro RaBj3ZX+qWF2/A7SoD58vsgm7P3vY8KYLj/z+ZutAZFr48etBv0ErkVongz/1uHtodq2 Sd4QM3aBaYRgtOTyheOfuogbft6mE4Qclr/bQxv2MwWHNAve8xCwZyGKqNb0H54XBfLn NG7Nsl1Mu0J4DCtTX4etQKVm0t5W/Ikz8ntVh0kY/gajp4SAYBkdBrIpczHP3tTie+QL RKwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X2h+lMHs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si5795355ilc.72.2021.09.13.03.41.59; Mon, 13 Sep 2021 03:42:12 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=X2h+lMHs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238846AbhIMKm0 (ORCPT + 99 others); Mon, 13 Sep 2021 06:42:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:54240 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238823AbhIMKmZ (ORCPT ); Mon, 13 Sep 2021 06:42:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631529669; 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; bh=ryXldKXp5w2qrYfIRmnB0eY0iF5R48B4/QR1QYkEKSY=; b=X2h+lMHsHwCg3NMLXqSVSzG69JXaSUh7Zjgp5jlq5SBK5xOE1t+5tkTsS8OdOZ560L6prk jQuk0WUdVNlAxqYTuWKPw9ezyabNsDcOtmt7W99xLsJ72u7jshf9brj7l0jd5Ax6IQcycL g16b8E8Tn/1FEDCCY+99Rtxum9Fez0I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-iyDlqZ8AMlGLjVZRSDBeBA-1; Mon, 13 Sep 2021 06:41:08 -0400 X-MC-Unique: iyDlqZ8AMlGLjVZRSDBeBA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A43C480292A; Mon, 13 Sep 2021 10:41:06 +0000 (UTC) Received: from asgard.redhat.com (unknown [10.36.110.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB9311036B24; Mon, 13 Sep 2021 10:41:04 +0000 (UTC) Date: Mon, 13 Sep 2021 12:41:01 +0200 From: Eugene Syromiatnikov To: Jens Axboe , Pavel Begunkov Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, "Dmitry V. Levin" , linux-api@vger.kernel.org Subject: [PATCH v2] io-wq: expose IO_WQ_ACCT_* enumeration items to UAPI Message-ID: <20210913104101.GA29616@asgard.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These are used to index elements in the argument of IORING_REGISTER_IOWQ_MAX_WORKERS io_uring_register command, so they are to be exposed in UAPI. Complements: 2e480058ddc21ec5 ("io-wq: provide a way to limit max number of workers") Signed-off-by: Eugene Syromiatnikov --- v2: - IO_WQ_ACCT_NR is no longer exposed directly in UAPI, per Jens Axboe's suggestion. v1: https://lore.kernel.org/lkml/20210912122411.GA27679@asgard.redhat.com/ --- fs/io-wq.c | 5 ++--- include/uapi/linux/io_uring.h | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/io-wq.c b/fs/io-wq.c index 6c55362..eb5162d 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "io-wq.h" @@ -78,9 +79,7 @@ struct io_wqe_acct { }; enum { - IO_WQ_ACCT_BOUND, - IO_WQ_ACCT_UNBOUND, - IO_WQ_ACCT_NR, + IO_WQ_ACCT_NR = __IO_WQ_ACCT_MAX }; /* diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 59ef351..dae1841 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -324,6 +324,14 @@ enum { IORING_REGISTER_LAST }; +/* io-wq worker limit categories */ +enum { + IO_WQ_ACCT_BOUND, + IO_WQ_ACCT_UNBOUND, + + __IO_WQ_ACCT_MAX /* Non-UAPI */ +}; + /* deprecated, see struct io_uring_rsrc_update */ struct io_uring_files_update { __u32 offset; -- 2.1.4