Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4204758rwb; Tue, 6 Sep 2022 04:20:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR50ue6YQI8inkHW1KC1vF89YqtgkAei3rjHHh6jxTm74XPtvAYjuvetTX67HdlpR9G7gY0z X-Received: by 2002:a05:6402:19:b0:447:901f:6b28 with SMTP id d25-20020a056402001900b00447901f6b28mr45967607edu.392.1662463204432; Tue, 06 Sep 2022 04:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662463204; cv=none; d=google.com; s=arc-20160816; b=PY2f+ljvPEqo5F+avvbzAlyaJ9eywtyZ0lI2P2nEOsrnG5fMUSA7Va3ol9kRgrsWoG ErqRooIFB2H4/GWeyCZhhHOYTAp25LwJOQrx4QiPJN+iqUMrZI7+RjzLqQ9iGcLhc3W4 wBlZuia9B9djjHRZxiUqw8+q7pL1gQbhslioSPd/dALo7TAcM8Fm8O1LrpSJvSKzfooz 6krwFwgp736vittNB72KWBAu5qFj8LlNryWsV+zFM1L1ftYzfOcWcPYaSMjEmtgOcIjh FGXblzvQpJUU8S4BNqX3DXJsijUhLsVo4+ZjrGoI5sC+z+IWUFfjV//TBweXTDDsfDi5 k77A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=TWFTmiu/F1naD+YA2QN797Qhc0+oXAueZY77zxu/bOc=; b=mmp17f4l7nTVooqVs3moEWW+J8C29IeE/fOtbioIi0nIvCktZMZ8juAPU+kW2i6yja KmkNiMVCOwzxp25HP8xDoUjVi9WVF2pXr0jYI+AUnM5CCF6NDVcFvw8Fw4PSH9slEBkb 5aFl5F6Fdpr677Wd4jvprGtpwJuG9hwIafB1VqYfySdraCPohiagl8Ab9eCXtc+5KUOy MmIMJ5Jf2nt47NvVRexAX+nyKXso3WcPOrTx+fHyeR9DuqmLXkx5Gu61uWaRF18V0Rcy YbN1SwlLy6L0yBVumm2xbd+OGwkVN2VOlt/bv23Ma2ecAqG/r7yZQ+amzrJq7IPzt1kQ swfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VedJouYe; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xd1-20020a170907078100b0076f689c8d27si755515ejb.254.2022.09.06.04.19.34; Tue, 06 Sep 2022 04:20:04 -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=@redhat.com header.s=mimecast20190719 header.b=VedJouYe; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234374AbiIFK41 (ORCPT + 99 others); Tue, 6 Sep 2022 06:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239681AbiIFK4E (ORCPT ); Tue, 6 Sep 2022 06:56:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2019913EB2 for ; Tue, 6 Sep 2022 03:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662461760; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TWFTmiu/F1naD+YA2QN797Qhc0+oXAueZY77zxu/bOc=; b=VedJouYeT4C/RsTWW1+ht1gmktvy2aPfniEfrEw5co5lvrdt3GIEgw8MHdgrbQe5e9NAq4 uzDp0HrtjT9mNI7CKbMoYTRlQ5p/EF9SENWppLErIKniX//aZL9aj+uN3Nj3Q6lTtYdUm2 8i9DCSAH75YuWgPFSEtUKSJXAjVmzbA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-326-C3HuPP8YPWOHUcLqKvKuOg-1; Tue, 06 Sep 2022 06:55:57 -0400 X-MC-Unique: C3HuPP8YPWOHUcLqKvKuOg-1 Received: by mail-wm1-f72.google.com with SMTP id i7-20020a1c3b07000000b003a534ec2570so8619158wma.7 for ; Tue, 06 Sep 2022 03:55:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date; bh=TWFTmiu/F1naD+YA2QN797Qhc0+oXAueZY77zxu/bOc=; b=ccf44BDpl5Xo92aPTbZp4GKkBnmUoEBHelZsz0Rpxuz97ALA3iC5vg5jF2TMrLnxIn 10LldIbOw73iytUlZtkb9mg5EEzG+C13PT9M4Hj/dsOrQDxFhNso1RMzw6fPrlsZ1Ug9 02NZihBDRcUrNBBf2lBYXqiFUUbVsqjTwgvzLHi3yOw1xwi1f5I5GBiIPtRdfD2FYGVh 2smid/JbHwxYXno45kr6bTwfC53kNChO5nl4tJb6v6J229+QzHxkIw9HdQ7QEsBNVXxW ePBZZNNrKFD+FWFHz3uXUqq2qj/GySJKF4NHVttL1SD4v/FYCXszH0SqnSrX8h3+vng1 Gg7w== X-Gm-Message-State: ACgBeo3jWWXhjt/6kl1zf+XWMZ53n3VFd0mxLiKA4Ehsz4EeuEehV7B1 CbpEP1uo1O9a7+KgLLAk7N3r/xg5UtEpJIzy0IO1tCdWlGxqBFnuHIMLPZDTozn0cnKlkvt7Y+6 PW1LXDns2JGNs17yL88hsAqFH X-Received: by 2002:a05:600c:3541:b0:3a6:28e4:c458 with SMTP id i1-20020a05600c354100b003a628e4c458mr13486801wmq.188.1662461756591; Tue, 06 Sep 2022 03:55:56 -0700 (PDT) X-Received: by 2002:a05:600c:3541:b0:3a6:28e4:c458 with SMTP id i1-20020a05600c354100b003a628e4c458mr13486792wmq.188.1662461756355; Tue, 06 Sep 2022 03:55:56 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-112-72.dyn.eolo.it. [146.241.112.72]) by smtp.gmail.com with ESMTPSA id e5-20020adfe7c5000000b0022862e037e3sm8611142wrn.38.2022.09.06.03.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:55:55 -0700 (PDT) Message-ID: <056ba905a2579903a372258383afdf6579767ad0.camel@redhat.com> Subject: Re: [PATCH net] virtio-net: add cond_resched() to the command waiting loop From: Paolo Abeni To: Jason Wang , "Michael S. Tsirkin" Cc: netdev , linux-kernel , virtualization , Eric Dumazet , Jakub Kicinski , Gautam Dawar , davem Date: Tue, 06 Sep 2022 12:55:54 +0200 In-Reply-To: References: <20220905045341.66191-1-jasowang@redhat.com> <20220905031405-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, 2022-09-05 at 15:49 +0800, Jason Wang wrote: > On Mon, Sep 5, 2022 at 3:15 PM Michael S. Tsirkin wrote: > > > > On Mon, Sep 05, 2022 at 12:53:41PM +0800, Jason Wang wrote: > > > Adding cond_resched() to the command waiting loop for a better > > > co-operation with the scheduler. This allows to give CPU a breath to > > > run other task(workqueue) instead of busy looping when preemption is > > > not allowed. > > > > > > What's more important. This is a must for some vDPA parent to work > > > since control virtqueue is emulated via a workqueue for those parents. > > > > > > Fixes: bda324fd037a ("vdpasim: control virtqueue support") > > > > That's a weird commit to fix. so it fixes the simulator? > > Yes, since the simulator is using a workqueue to handle control virtueue. Uhmm... touching a driver for a simulator's sake looks a little weird. Additionally, if the bug is vdpasim, I think it's better to try to solve it there, if possible. Looking at vdpasim_net_work() and vdpasim_blk_work() it looks like neither needs a process context, so perhaps you could rework it to run the work_fn() directly from vdpasim_kick_vq(), at least for the control virtqueue? Thanks! Paolo