Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3909539pxb; Mon, 4 Oct 2021 12:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzPFAwj50dpZn6EADUC0FInLOrrTbc8wIHErDrUP1HJXbBNcYGANZjBrtYfCzLSp8lU3Jw X-Received: by 2002:a17:90b:2247:: with SMTP id hk7mr12146296pjb.72.1633375428811; Mon, 04 Oct 2021 12:23:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1633375428; cv=pass; d=google.com; s=arc-20160816; b=EMj620VJvV+AAu7Vl6O/iF4udppr/lCXp58INO49x2kEjjgNF1gwI7w8gST/CqFyIP YGltPJ27uEiw5Zwbb5vw4iha1skIAQDa9Hc4nzCQBWyWu84IKtwkIDB0O+QdNqbs1oNW 7y/pVLrwKhR+XV3XZiPM+D7CsFJg+jSppVvWAVlj19ojHo3aXSiyx7ykicrxtEaQ6nka 5cZQxHgYKgH5+E3SEJ/ssfCGwyQWJnWxrB0idSHE0gyOYKS+SzAMLML/Wutu4Lr3c9Fu fqSJzoMfMSFk5tE7O8B4rjoTjd82StonleTg9xTzHMQKIsKpGOAA7GI2v+ARUeMxrlxM vrBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=5W4ziSqooVtD/2GrxiD8RqOzuuK6GS2woUlCxi7bDZs=; b=GUSf3VUQoA5JQuKcA33LSDx4oHsUtxpePpnzjX7nPY4J5J+yLTvqxEbLk1nBB0DBGl 4q4XLi0h5Tk69i8K3+tcXKit/v4U3T8A34ATuBuB7NbNPbSx3cjGVdo3Qs+UbQ8urRhl rJxHwSKvs52uDfcPBFXCaQjDIdF7instzRCZmWSZU5QgdM9sYfqqjd4gV+YzvSFSTJYV Q7gWBfjlCuChumVWFvh49Fd7pjcyvgoRBEaYmC51XrHRW339ge7Jcc+8JPIRy/Gl1SD2 /3OYt/9c41+QzN3GUIjAFHHI4NLHLq8MB6ywpON8UYJgnnW5WAgqLflqFHZHhher6wYU u6XQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b="cnYC/IBr"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bd7eC0RP; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si19498032pgi.36.2021.10.04.12.23.29; Mon, 04 Oct 2021 12:23:48 -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=@oracle.com header.s=corp-2021-07-09 header.b="cnYC/IBr"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bd7eC0RP; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235685AbhJDTYH (ORCPT + 99 others); Mon, 4 Oct 2021 15:24:07 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:61858 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbhJDTYE (ORCPT ); Mon, 4 Oct 2021 15:24:04 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 194JJB9Y019448; Mon, 4 Oct 2021 19:21:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=5W4ziSqooVtD/2GrxiD8RqOzuuK6GS2woUlCxi7bDZs=; b=cnYC/IBrINbxjoCaUtLr1zEhh2m++A2haGUff6CpDwEekB7YJP9R/vKehQmztJWOQPG1 NlI7SY8r+r90mn9l3ptyeAe+/XVH/ypH/lIx1L6pUWrRzMCTxsOuu/PcE0ajNpYbp7hp RZ5nF3crAZ4T8VDZH5WjGs02k9VG4qjfYlpEhkFYXNZ0bL7b0twcuQYcBeiKI/1rnhc6 gX5FyNeUU4aWuFTmB7EzFcRsHH4RSr9E93xBSwQdb80Y/L3VSRO15AHfoOJts2ed84Mb 80Z2KnI63zuONA6c+fMmmkpVWYjD7ck00oS7pqd0Z0loptPpeuBqSU+FkLVaY5MvUClY Hg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3bg3p5aat6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Oct 2021 19:21:41 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 194JAcLu132330; Mon, 4 Oct 2021 19:21:40 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by userp3020.oracle.com with ESMTP id 3bf16rwfhc-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Oct 2021 19:21:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AU4Ic0oahdTXDXJuoDV0cjlf2o2mnyLf6Rdfpx/oSmvcgxPyL9Lbwh7nFz8/Frvi4FlG8dniUhR17GO1Enx+QM01bAircDX11XQDvbKsxJcmv4r3hsXD6spl1a8s2vXINIDXHx5W2KTZHG2rYsIgXwg7WZ2ExpCQNzB5tgg5woI93bCDB+6ObxjeyOU4omqYhG5RcjZ9baLhw5CmWj80ad5RX0IKH4HKiFV1aeTW4y/lurBKTiMRg/ilzYbP+qON15Jsezt7LOS4K/MGn+jvWyfDXCuwHXOd9OH91gysE66AiodXSx/rsCyVTdcPSAaKOe+AQB+uZJiw2oqUsADh2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5W4ziSqooVtD/2GrxiD8RqOzuuK6GS2woUlCxi7bDZs=; b=l+vciudpu4ZUe3IPDy5G14PSzyRfCdEIiI5veZXBEE87zTEjeZfBVm9v/H3LFTCzGT+ntCk2yoGIQ5thAbVfDtWgEZrUswaO+7qQqgFR7SX38dxNAO7htNA0Wrv+/8Y7JHtpJ3u63zmdjMEFIALkzoSMdMBKmemmRekIwqklOiIK8sSdtQZzg5H6vWSDZrcz0jMiNlO2SOVX9p238EaOhDMN0cwyo/F4gdhunnZQ3KkOSg4ATBlyxIzEpk1Ks3RmK09dVwKiNiXp/Q/SjvbjcADmVQg5HBLeLWJk1LwajqNkmgpA7sKyBnv4O5rlqLHG71pdS6DOcvUtQvsVH8VkDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5W4ziSqooVtD/2GrxiD8RqOzuuK6GS2woUlCxi7bDZs=; b=bd7eC0RPACzx7MJyHtZa2IdpA6jLTb8rIxKJfv5UWtnPT7JrSQvJeZsr7aB3f0lGUSQoxaVFpSGUPIvRQLXnBqVRuqhIhs0XnQRcpw+rzUiOvqAu8EwUlcShpOnbjUYxCkgU9zLJjG3r+cmLJGc6yZTF0OBiKEcgms14VtST5Wg= Authentication-Results: linux-m68k.org; dkim=none (message not signed) header.d=none;linux-m68k.org; dmarc=none action=none header.from=oracle.com; Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB3307.namprd10.prod.outlook.com (2603:10b6:5:1a1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Mon, 4 Oct 2021 19:21:37 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::195:7e6b:efcc:f531]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::195:7e6b:efcc:f531%5]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 19:21:37 +0000 From: Mike Christie To: geert@linux-m68k.org, vverma@digitalocean.com, hdanton@sina.com, hch@infradead.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org, christian.brauner@ubuntu.com, axboe@kernel.dk, linux-kernel@vger.kernel.org Cc: Mike Christie Subject: [PATCH V3 1/9] fork: Make IO worker options flag based Date: Mon, 4 Oct 2021 14:21:20 -0500 Message-Id: <20211004192128.381453-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211004192128.381453-1-michael.christie@oracle.com> References: <20211004192128.381453-1-michael.christie@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM5PR15CA0034.namprd15.prod.outlook.com (2603:10b6:4:4b::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0034.namprd15.prod.outlook.com (2603:10b6:4:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Mon, 4 Oct 2021 19:21:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fda70891-5f5f-460e-1a18-08d9876c2fb0 X-MS-TrafficTypeDiagnostic: DM6PR10MB3307: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DuCQds3QDCttxgamHRfIIZ1Agt9Y8dhf5gRNyTSPmJyENvsduzx0nnUsviqGfCOEKhcNHIQ/PBbdcocXD0ki/YPxbSOTgScauB10pq6t+9M6JkLIl46woS4lPLVwq3KcM+qn8m0tRcLstggsspNC8miYJn88gbG44AAYqO13ZbrXV46Mr/k/RylFR7jbukiYHrCQJdP3V40nBmRA4mdoNxcXXAEPJDPitbEqnPj/ZTTMjmWC9KWeb210kWMTzfGwcQ9Xh2Mqnkvv+pFzUZEmOQMl0ic/LAoVd/KcuTRcakf1rwJj99Iu/6NydczzcZUSbAaSWY3ODW9b6baPMLefdZkXxFIp25/fzCNtOga+0cIT9RLs5lBB57Xz+0GctNEQgl1XM90U8vUnsAvP8O1eKmengQycW93B1znMr+kqsyL0DsHemsbo+FbvhqcqN49HFaGK2991v4zKS17dWNsElVIKqxRyEJCqiGAk7cKUgfv7irUosECnBHWED0E5I/cagLSfWpGASsk0V7HBANlmS9UdyXY+opPjqlsMeu8xK5e7VZpNFG4B9VSl97sQsdoZx5nooWn69dYws9AmhRv1q2VYGfW2LnZv6B2T6Z7E8Ow+Ph5jra2zucpPi9NIkEF4kMpILfwnBO448y/7jXbkYadEpv8fjUoVdass2UpH+w5213G/y7GbiRJ8yxoCTqM858BUXdbuR8+FDBovKVzYMTkjkGdfujaSOo3PNf9wqN8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(66946007)(66476007)(66556008)(36756003)(1076003)(107886003)(6512007)(52116002)(6506007)(83380400001)(2906002)(8676002)(8936002)(6486002)(26005)(6666004)(186003)(5660300002)(4326008)(2616005)(7416002)(921005)(508600001)(316002)(956004)(86362001)(38350700002)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/t8UQSLObxl/kpVyFj3Hl6WiEAMGLHgS7T7IiKpKGh66GUuHCKdG2NJk4Vei?= =?us-ascii?Q?sxQK/kTwMJb5SeyfiefX/7h0JReNYiNuUAb01ya09BbtIsTrYY3gmGzp17+c?= =?us-ascii?Q?6i+Ng3Il4kd3LeTIeKOzaqwAog/Pk4SB7YNWITI9qm9er+trXvGiZX/YvcbP?= =?us-ascii?Q?ruJA/bi4lygGGsP/LQHEro5jzkYwNt5xP3u1xAQouUW8VxUEQNicjJPJVEkV?= =?us-ascii?Q?i69qTBmocdWXFBm+RUHRnbfBXI+3db1YS2sGooovTot6bSulPpP1dQ/o2cIL?= =?us-ascii?Q?fm73HGJGCO1KbMsBPLoUqeGd7fiRfpKrGb2OrwFZZLERZXYILBYWXhkwTI2l?= =?us-ascii?Q?eZ9LGsOz1BLKAcB57rL6hC5gpK/+DKtz2c+OZ50t0X54t5LHv238Awls0dOR?= =?us-ascii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i3ggDZeg+VOBO3tI0Q?= =?us-ascii?Q?n7TNKY7hC9eLOmr/pjRLr6SN?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fda70891-5f5f-460e-1a18-08d9876c2fb0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 19:21:37.6993 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PWKvrraaxrVFcMr7PaS9sbN5fY4lW41tY6VF3q7BXRT7dYo6vMGUlCGI0bRQtpzi+8sKaWaiwPu57pumeLj/x+hzIm4lDd/Q5wXVwvpkNTE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB3307 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10127 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110040131 X-Proofpoint-ORIG-GUID: WyqqyN5Ohm1VJkAWqvs9hpcKWrfV7H5K X-Proofpoint-GUID: WyqqyN5Ohm1VJkAWqvs9hpcKWrfV7H5K Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds a couple new options to kernel_clone_args for IO thread like/related users. Instead of adding new fields to kernel_clone_args for each option, this moves us to a flags based approach by first converting io_thread. Signed-off-by: Mike Christie Suggested-by: Christian Brauner Acked-by: Christian Brauner --- include/linux/sched/task.h | 4 +++- kernel/fork.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index ef02be869cf2..48417c735438 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h @@ -18,8 +18,11 @@ struct css_set; /* All the bits taken by the old clone syscall. */ #define CLONE_LEGACY_FLAGS 0xffffffffULL +#define KERN_WORKER_IO BIT(0) + struct kernel_clone_args { u64 flags; + u32 worker_flags; int __user *pidfd; int __user *child_tid; int __user *parent_tid; @@ -31,7 +34,6 @@ struct kernel_clone_args { /* Number of elements in *set_tid */ size_t set_tid_size; int cgroup; - int io_thread; struct cgroup *cgrp; struct css_set *cset; }; diff --git a/kernel/fork.c b/kernel/fork.c index 38681ad44c76..3988106e9609 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -2026,7 +2026,7 @@ static __latent_entropy struct task_struct *copy_process( p = dup_task_struct(current, node); if (!p) goto fork_out; - if (args->io_thread) { + if (args->worker_flags & KERN_WORKER_IO) { /* * Mark us an IO worker, and block any signal that isn't * fatal or STOP @@ -2526,7 +2526,7 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node) .exit_signal = (lower_32_bits(flags) & CSIGNAL), .stack = (unsigned long)fn, .stack_size = (unsigned long)arg, - .io_thread = 1, + .worker_flags = KERN_WORKER_IO, }; return copy_process(NULL, 0, node, &args); -- 2.25.1