Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp631992rwd; Thu, 18 May 2023 01:30:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JDXS3tENTV3kMxxZgTTKv1Ul2qGglEdPSv7tbxkAXewDUPc6MteZZiLefAQZ69y4zwUJu X-Received: by 2002:a05:6a20:1050:b0:f2:cc6a:932 with SMTP id gt16-20020a056a20105000b000f2cc6a0932mr1282661pzc.49.1684398632979; Thu, 18 May 2023 01:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684398632; cv=none; d=google.com; s=arc-20160816; b=pemIVJsr6+AZSDLM/h2qRGctuMxfox7shY2u3AuYSWdpsdMI0Hzh8zMrTOZS08Vrcb sM1plY11G9r01IDxrGiDQMaOAPFCRVyaPS480haLaUOA0vIF0iim5kLvRBlG5IKO6osf DrWUGQbs+mYPMjSA4aG3dAeEiqXPusSPiAwGSo2GUqPJdjbNHp2KFQId68cx3Q7RD0Tm VnUYI8TT33JoVD8MNYganChGGqRuFysXxZhROWkTDD4FDAnb2rYbt/YEEfc/fq9ry9pw BGRtyUFLFL0cm3dxKWQeRjllaGgLTIEo5c5fD9WjSW5sav/z0Jscyb+qhxH5wq6Sa11G S5Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jO5tOf04IjMKInY5kMY4BA3hjrbfXNgXINOQboIzdc8=; b=reLqDKwrGv6uja4it/HRGH/ksyen5u1jFv/XETWMO9oyO7nhFMfYg+XfLFNH85WO/e V04qxpGTZ0NK21JABkEu+NVEmq1PzIZSsD7fpcY9cJX4oGJvwCsN2eipYGaaGVyVR/sl NIDkjb+n1LKLC0/bsw5IL9gPLkRMxcYlwRPzSHw0oMMFMmremHhzTiZ7O1y26FJA0O1P +ELbHwejvd9pbFHq0HdW99qAAANKY48Uzzckxc+8aLE+wmcW5pCMLFPffooB3BkwU9QD 8N1g5AnO8KZqWkLroj9sHgoFElVLO+CvcXLO2mLaRIw8lVy66CrUD2c6/+wf2VP7L4OF +Eng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ov0jktHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p37-20020a635b25000000b004fbd2a5db20si792142pgb.538.2023.05.18.01.30.20; Thu, 18 May 2023 01:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ov0jktHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjERIZd (ORCPT + 99 others); Thu, 18 May 2023 04:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjERIZY (ORCPT ); Thu, 18 May 2023 04:25:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57CE52722 for ; Thu, 18 May 2023 01:25:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7962560C1F for ; Thu, 18 May 2023 08:25:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D83B3C433D2; Thu, 18 May 2023 08:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684398310; bh=QJpMhH0TJiHzSerzZJVxxkzNu0w5DrjQrRF0GKGv91o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ov0jktHeTEfxsVqpwFx2dHtIeDnt3l2OKg2mm1lMx/LrKOY6/OiQ/Ti8jLOFY7Red +EgJ09imHKNglOL5wWEmBC67f81H5hf3rxuLHOXEy+k/6weler8mcrPnMiZZ9tqoni FQiaWGQjbmN7Zt8kWNPSLgcVMwfN5X5jbphW6Up0AvgQzhXmoJQHlBornFtcDcU4SW ggYuX1T0JAER6qMMVkeKzIgN0YEozmRCk8myK9UoUqLDZgWonsRbYdY1dlS+Y+1Y4N tXuWStt2LT2lhDPpw1GMgKtxdCENCCazPtzLCLoZq597iferaqeG7acL4DoEeyCtB5 1DIX6+eZrEKRA== Date: Thu, 18 May 2023 10:25:04 +0200 From: Christian Brauner To: Mike Christie Cc: oleg@redhat.com, linux@leemhuis.info, nicolas.dichtel@6wind.com, axboe@kernel.dk, ebiederm@xmission.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, mst@redhat.com, sgarzare@redhat.com, jasowang@redhat.com, stefanha@redhat.com Subject: Re: [RFC PATCH 0/8] vhost_tasks: Use CLONE_THREAD/SIGHAND Message-ID: <20230518-appetit-aufsicht-238e950b97d6@brauner> References: <20230518000920.191583-1-michael.christie@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230518000920.191583-1-michael.christie@oracle.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2023 at 07:09:12PM -0500, Mike Christie wrote: > This patch allows the vhost and vhost_task code to use CLONE_THREAD, > CLONE_SIGHAND and CLONE_FILES. It's a RFC because I didn't do all the > normal testing, haven't coverted vsock and vdpa, and I know you guys > will not like the first patch. However, I think it better shows what Just to summarize the core idea behind my proposal is that no signal handling changes are needed unless there's a bug in the current way io_uring workers already work. All that should be needed is s/PF_IO_WORKER/PF_USER_WORKER/ in signal.c. If you follow my proposal than vhost and io_uring workers should almost collapse into the same concept. Specifically, io_uring workers and vhost workers should behave the same when it comes ot handling signals. See https://lore.kernel.org/lkml/20230518-kontakt-geduckt-25bab595f503@brauner > we need from the signal code and how we can support signals in the > vhost_task layer. > > Note that I took the super simple route and kicked off some work to > the system workqueue. We can do more invassive approaches: > 1. Modify the vhost drivers so they can check for IO completions using > a non-blocking interface. We then don't need to run from the system > workqueue and can run from the vhost_task. > > 2. We could drop patch 1 and just say we are doing a polling type > of approach. We then modify the vhost layer similar to #1 where we > can check for completions using a non-blocking interface and use > the vhost_task task. My preference would be to do whatever is the minimal thing now and has the least bug potential and is the easiest to review for us non-vhost experts. Then you can take all the time to rework and improve the vhost infra based on the possibilities that using user workers offers. Plus, that can easily happen in the next kernel cycle. Remember, that we're trying to fix a regression here. A regression on an unreleased kernel but still.