Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp923336rwr; Fri, 5 May 2023 06:58:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jMIMnNfPcm/sxpjQGkn2LaUu3X+egBRuVZvvIPbIIEVyYL/TeLckZHtgsIZkJINvcIuEX X-Received: by 2002:a17:90b:97:b0:24d:fccf:7ba6 with SMTP id bb23-20020a17090b009700b0024dfccf7ba6mr1521936pjb.43.1683295080674; Fri, 05 May 2023 06:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683295080; cv=none; d=google.com; s=arc-20160816; b=wTufZOejx2y5QoL6w5OilOizUQM4a0k1urdkAXzwUDTkJGYeZlep/7GzPpJPeiJxL2 kjdaeTDy0KJyzP2FzHLMDJvT2y8ssdmpmFgBakM5Cc4Hjj0bWrJuByVomVJpThrO7mXx cfJ0PEHoPGvQJYSd7dZcRL2LaG93z4jezW9dn1SjU3s9Ec4KPt3sRaqzMW4om8ngMtvF 1NAY8A9CcKweUXnsjJ0bLzDs69aJLP9yp4OE1BPNixXNLY73aEBQjE807AL/+0ttO7XL sO1DvKDkSHtmKavo+6f2UfTjWmy8iROzkh8104VYlLd17QWmmTvrJ5ookqrEiceRBxBu 21yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:to:content-language:subject:reply-to :user-agent:mime-version:date:message-id:dkim-signature; bh=4FanM4o2uM5el5CxuMhWsVKBSn5kagBvJULfEwuOnuQ=; b=GjiObihEModES4ZVWKMzuInY6ztdVVReWPKUmnl4Ap5CxZ5Ldh11s5cWALKTcmjK7x Vz+VkWT0iPt6PcOGULT3ikh4XOCV3eg5ssPl+RVZuNTyzjXmBcQOXAwMBwnKiS0zfboU 2plfoMjKfkxavsdC8Ux5mabN/rC/89vRhxBb+M8Q+kzMkB52GZZH6rmf0UMPn8KLaqpa g6Ex6MYCJJrOr0xklQA/KsGlLoIlPvyGAY0FoYTD0CXaBfaQ66hXmIYjhcfWURrk68lr 3/IORAz9a9RKvQwrgGTGVb1ZsRwo296F8H84QYzly/YRpldw3rWy4A49MMdIZjQwIxp0 SPZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@6wind.com header.s=google header.b=YLbCpjzK; 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=6wind.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj14-20020a17090b088e00b00247074f8281si9816960pjb.90.2023.05.05.06.57.48; Fri, 05 May 2023 06:58:00 -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=@6wind.com header.s=google header.b=YLbCpjzK; 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=6wind.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232691AbjEENk1 (ORCPT + 99 others); Fri, 5 May 2023 09:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232694AbjEENkZ (ORCPT ); Fri, 5 May 2023 09:40:25 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2B54203F9 for ; Fri, 5 May 2023 06:40:22 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-2f9b9aa9d75so1220039f8f.0 for ; Fri, 05 May 2023 06:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1683294021; x=1685886021; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:reply-to:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=4FanM4o2uM5el5CxuMhWsVKBSn5kagBvJULfEwuOnuQ=; b=YLbCpjzK6cMNG74LCoKCtdGlOP2jnpt1wMFGhzesPsF4VXoaHVhGGJYCbTZIIr7ZWK BWELmOv2DZ+FvVC+tF5YJnncwBFB0yiLD5AALWHY+GiIeHx0Vmp1AY5zfSygfaP4nPhw zY9Riyo6J224ooL5tZye7BXLtAkIys0BjMQauhWjLjMqQKB8mkr3P3neHc8N4sFQWuIv hbtyoWcvla5onI5lDFcKGCQbzFbozblPUB9PAlFum6yVf34N1OBd1YUzaeflrCVfPw7y BvPO/+u54OQmZ6HCBDlOsjDaNMo2pQsp2HA+mUHKA6LdD5vRHffvhQLE2/xwhVfkb770 aLlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683294021; x=1685886021; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4FanM4o2uM5el5CxuMhWsVKBSn5kagBvJULfEwuOnuQ=; b=Cat3k9TbkUnmGbHiQ5YH6t541H70ZMSZstPb+t6y17xTXclHwe26sPae5gM0FsYq5y klmdaBLnCLKSrbAWkwIWK0yU7UNdsUAh5fPOk+9+k3m4yI6V4DQOlUe16nrB5uP0yNcY RO4wKR+e2GJq285W1iVadgGTN5kWsBSVfIrBE8AxzSI7jLYFPlVClV5D15pktONgFiL6 lc9vI9JggvZAX9nm5VVnMwOzF8T3DwHfjC6mb0/Spb5Gd0d5FJyY+udBKQQoVuJNueDt MZfFlwN1uw7n0ONbH40X573VKgErWsLcLHv828OxGGPLLYZ0wyFlWbMWOc7yjrlv8BiP W4ew== X-Gm-Message-State: AC+VfDw3pLiddP0YIxKpOqZ+YEwNR4Mg9pPTDRYSRpoz23iDFICfP42C YW333sdnTwwULP38CAic+A8crg== X-Received: by 2002:adf:dbc2:0:b0:306:3814:e323 with SMTP id e2-20020adfdbc2000000b003063814e323mr1303552wrj.56.1683294021330; Fri, 05 May 2023 06:40:21 -0700 (PDT) Received: from ?IPV6:2a01:e0a:b41:c160:91e:3457:e7c8:8f10? ([2a01:e0a:b41:c160:91e:3457:e7c8:8f10]) by smtp.gmail.com with ESMTPSA id y15-20020adfe6cf000000b0030633152664sm2431032wrm.87.2023.05.05.06.40.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 06:40:19 -0700 (PDT) Message-ID: Date: Fri, 5 May 2023 15:40:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH v11 8/8] vhost: use vhost_tasks for worker threads Content-Language: en-US To: Mike Christie , hch@infradead.org, stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com, sgarzare@redhat.com, virtualization@lists.linux-foundation.org, brauner@kernel.org, ebiederm@xmission.com, torvalds@linux-foundation.org, konrad.wilk@oracle.com, linux-kernel@vger.kernel.org References: <20230202232517.8695-1-michael.christie@oracle.com> <20230202232517.8695-9-michael.christie@oracle.com> From: Nicolas Dichtel Organization: 6WIND In-Reply-To: <20230202232517.8695-9-michael.christie@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 Le 03/02/2023 à 00:25, Mike Christie a écrit : > For vhost workers we use the kthread API which inherit's its values from > and checks against the kthreadd thread. This results in the wrong RLIMITs > being checked, so while tools like libvirt try to control the number of > threads based on the nproc rlimit setting we can end up creating more > threads than the user wanted. > > This patch has us use the vhost_task helpers which will inherit its > values/checks from the thread that owns the device similar to if we did > a clone in userspace. The vhost threads will now be counted in the nproc > rlimits. And we get features like cgroups and mm sharing automatically, > so we can remove those calls. > > Signed-off-by: Mike Christie > Acked-by: Michael S. Tsirkin I have a question about (a side effect of?) this patch. The output of the 'ps' command has changed. Here is an example: Before: $ ps PID TTY TIME CMD 598 ttyS0 00:00:00 login 640 ttyS0 00:00:00 bash 8880 ttyS0 00:00:06 example:2 9389 ttyS0 00:00:00 ps $ ps a PID TTY STAT TIME COMMAND 598 ttyS0 Ss 0:00 /bin/login -p -- 602 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux 640 ttyS0 S 0:00 /bin/bash -li 8880 ttyS0 SLl 0:10 /usr/bin/example 9396 ttyS0 R+ 0:00 ps a $ pgrep -f example 8880 After: $ ps PID TTY TIME CMD 538 ttyS0 00:00:00 login 574 ttyS0 00:00:00 bash 8275 ttyS0 00:03:28 example:2 8285 ttyS0 00:00:00 vhost-8275 8295 ttyS0 00:00:00 vhost-8275 8299 ttyS0 00:00:00 vhost-8275 9054 ttyS0 00:00:00 ps $ ps a PID TTY STAT TIME COMMAND 538 ttyS0 Ss 0:00 /bin/login -p -- 540 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux 574 ttyS0 S 0:00 /bin/bash -li 8275 ttyS0 SLl 3:28 /usr/bin/example 8285 ttyS0 SL 0:00 /usr/bin/example 8295 ttyS0 SL 0:00 /usr/bin/example 8299 ttyS0 SL 0:00 /usr/bin/example 9055 ttyS0 R+ 0:00 ps a $ pgrep -f example 8275 8285 8295 8299 Is this an intended behavior? This breaks some of our scripts. Regards, Nicolas