From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38953190664 for ; Wed, 8 Jan 2025 12:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736338998; cv=none; b=uMGo4KTwTi7xtwN1SWXyXjk+gEcFISPRzM9I8I0ZTI3M2LPSeS7radPZXrAnle6BNg5bQH8vrpq9/HLugKv+T8x0xKD/6zI64rsbHrFMWmVNSF6LZgArBXHkFmsnQF5KMn3iUH6tZulN1e93fwLMQ8N6rH9T/1yJv9DubiXnnZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736338998; c=relaxed/simple; bh=CYEL1xsMWMcBwANmoFnaeB+RsMLozxlw7Y9ZKV5IL4M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pfiS3yxUcV8WTJNToxeO7tyQXkzgYSWEyLVO/Dni59nVrxTH6oT4x7BRjJjs3CE7YeHk+DMobNcZJRZH2nr+krwMimwjmEQw/AP12EGCQTgDDOnyZpNJH9rAaN5Yhi8wbxnNbcF5oSwOxfuQcuLr+MVGSW1HzFzm82+e7ff7tHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Bi00FDtu; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Bi00FDtu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736338996; 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: in-reply-to:in-reply-to:references:references; bh=jtNPZrhPuEXDAUmk7MMSLxT+pmGkUlhGX8IMqmFXcVs=; b=Bi00FDtusYef6RUS3D+WcfmJHOOrsx44+PGhTEbWLSqRfU0Y3kmFX91SCZK6r1tjsYQ9HB sfGCvbdDzgZmN65EhL9Z6GCP1nzEok1q8wBQRLUBvHs81BT8vaYlOR58z6WRSMzaPuueG/ 5A9beLU2ktZCAgEuSjplvLNv90Pl4Bw= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-vz0FhoIKPw6QPLl9WIOHzQ-1; Wed, 08 Jan 2025 07:23:14 -0500 X-MC-Unique: vz0FhoIKPw6QPLl9WIOHzQ-1 X-Mimecast-MFC-AGG-ID: vz0FhoIKPw6QPLl9WIOHzQ Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-aa68b4b957fso760488366b.3 for ; Wed, 08 Jan 2025 04:23:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736338994; x=1736943794; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jtNPZrhPuEXDAUmk7MMSLxT+pmGkUlhGX8IMqmFXcVs=; b=gczYdQ1828MAzJnx6bAzSpP8/pbpmI2B8uyHxiyOjGg7rDbvlX65i0QcUgfDhThP5q 7pju+deB1q4VbkhtfeYw+akxdFf9ap+l2pUVTU1XlV7Ob1M+N/4r62uN5KPN0Ptb19TO w+fDPfEvd+rW7rjP1ZLkwrTc1ikYev26PxR3Gts1i29OxjG/HiNAFguH/Gaaps+1FK2U AtQtvJKUAOT82dYRmrdusZPGFryhsVygCdLn2yROvbmKAqENOHOpDgOStggKSwoRjerO bH0HNrJmpimrQWy+HfnQZouWXlLZepLQFnHlAutPrJa6GxLSN6zwWV/gR3+3EhjokHQA 7J7w== X-Forwarded-Encrypted: i=1; AJvYcCWd5LxqYhRJoNGNUMbX9J64DxkhR9MhHBF8MhaCMAlnTixRT9U0H8CnvMb5zndgtl7tCTjOuVyJNCW6O6U=@vger.kernel.org X-Gm-Message-State: AOJu0YzgB/INwXSiB0DabAujs5iGUHDRJFv/EyfvhOSo2WTFEiuLWiRO gzD04jVGw82KnzH9kyyTQROQsz/8HpTIr5of12fbzjrcjzdstvthZT22qXqjZmdq1bpZj8wqWLO foDOsG9JRgv1vBwKpbH7h43jtrPdO0Af8RZxvuBcsa7fG6PEY6GGkaAz2onoT9A== X-Gm-Gg: ASbGncvk9b/gUHR1aicLogulPDgZEVpBteyHTRqiIuvQ55JOt8Iw07tjVModzsBsAr6 Xy5Avf9QYTS5h7JDJiX3OkL0MCNSqTtm845AKqCWxv+ysO7kSRJV91R47QsiB+osZp1c7oMSpDL VbnAGC3EA2h/0+K4/RLesufTdmuzUZxzzvG5NkAQ9IS0uqLp8rGDcLuysjE7JeY/J/tQNfdrZdQ /KJm+8nvh+/MCDneTlsCfX1v/+Q9TvMOKq80ENu7Xcnt2OMuxk= X-Received: by 2002:a17:907:1c96:b0:aa6:6a52:970 with SMTP id a640c23a62f3a-ab2ab6a7603mr214442466b.1.1736338993614; Wed, 08 Jan 2025 04:23:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgJ2ItxqbcNpBvhzA7PF267wqdTMYaBrex8PA7k15rP1ubt/sLuYmBO/GJPJLWwYew7P6vYw== X-Received: by 2002:a17:907:1c96:b0:aa6:6a52:970 with SMTP id a640c23a62f3a-ab2ab6a7603mr214439666b.1.1736338993060; Wed, 08 Jan 2025 04:23:13 -0800 (PST) Received: from redhat.com ([2a02:14f:175:d62d:93ef:d7e2:e7da:ed72]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e82f616sm2481777466b.41.2025.01.08.04.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 04:23:12 -0800 (PST) Date: Wed, 8 Jan 2025 07:23:08 -0500 From: "Michael S. Tsirkin" To: Cindy Lu Cc: jasowang@redhat.com, michael.christie@oracle.com, sgarzare@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org Subject: Re: [PATCH v5 0/6] vhost: Add support of kthread API Message-ID: <20250108072229-mutt-send-email-mst@kernel.org> References: <20241230124445.1850997-1-lulu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241230124445.1850997-1-lulu@redhat.com> On Mon, Dec 30, 2024 at 08:43:47PM +0800, Cindy Lu wrote: > In commit 6e890c5d5021 ("vhost: use vhost_tasks for worker threads"), > the vhost now uses vhost_task and operates as a child of the > owner thread. This aligns with containerization principles. > However, this change has caused confusion for some legacy > userspace applications. Therefore, we are reintroducing > support for the kthread API. I briefly applied this, but there seem to be a bit too many nits. So I will wait for v6 with everything addressed. Thanks! > In this series, a new UAPI is implemented to allow > userspace applications to configure their thread mode. > > Changelog v2: > 1. Change the module_param's name to enforce_inherit_owner, and the default value is true. > 2. Change the UAPI's name to VHOST_SET_INHERIT_FROM_OWNER. > > Changelog v3: > 1. Change the module_param's name to inherit_owner_default, and the default value is true. > 2. Add a structure for task function; the worker will select a different mode based on the value inherit_owner. > 3. device will have their own inherit_owner in struct vhost_dev > 4. Address other comments > > Changelog v4: > 1. remove the module_param, only keep the UAPI > 2. remove the structure for task function; change to use the function pointer in vhost_worker > 3. fix the issue in vhost_worker_create and vhost_dev_ioctl > 4. Address other comments > > Changelog v5: > 1. Change wakeup and stop function pointers in struct vhost_worker to void. > 2. merging patches 4, 5, 6 in a single patch > 3. Fix spelling issues and address other comments. > > Tested with QEMU with kthread mode/task mode/kthread+task mode > > Cindy Lu (6): > vhost: Add a new parameter in vhost_dev to allow user select kthread > vhost: Add the vhost_worker to support kthread > vhost: Add the cgroup related function > vhost: Add worker related functions to support kthread > vhost: Add new UAPI to support change to task mode > vhost_scsi: Add check for inherit_owner status > > drivers/vhost/scsi.c | 8 ++ > drivers/vhost/vhost.c | 178 +++++++++++++++++++++++++++++++++---- > drivers/vhost/vhost.h | 4 + > include/uapi/linux/vhost.h | 19 ++++ > 4 files changed, 192 insertions(+), 17 deletions(-) > > -- > 2.45.0