Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2858305rwl; Tue, 27 Dec 2022 00:14:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvkAji7TE7/hatQfj31Vo2tIpvin3U9BFeX8fKTqAd/se3ws7VSwdTLzs5sCd/Uyu9XQtHp X-Received: by 2002:a17:907:8d1c:b0:7fd:f3ae:8ab8 with SMTP id tc28-20020a1709078d1c00b007fdf3ae8ab8mr19212159ejc.9.1672128866293; Tue, 27 Dec 2022 00:14:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672128866; cv=none; d=google.com; s=arc-20160816; b=rHOuwB4RvN9guGF3xQLAmNLE/nNOWsmhwHBZvrp8ase71BJ2VjNjhdbXYVt6BQik0k EM4eN5+w23n9th9TAPyNuieAuSC0EvXim+i0bq1YxAwfbue+iTeBfidv0c7FGr7xaXlE Me0yIn89QiMwGYwemq74HjUJvSzIstBEYN0qw/nQ1I7IyTuKCOU8oj8HY22UDX2bGoeB fVAvXIxDC0htUWD57mmtnICpy+JK6IlvPXH3FthRtkhczBkcoUJbwiq0WW4+IWBEUkVW e4gxzQZtNuJUL83OjYxf3dDAFoPjK5KG6vynqYP1mm8acq8hCxRN5UQG7q7589L+JUKa Xs1w== 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=h2F2GH9r8G5/9JPGcKQm0Kg39TfbvH77Y/WP493sark=; b=AtUJyLlQF7SqlMLPV0U8Vz6cywnnhoD4rEhhZ98Bu/45ZBYVfqB9aDLj7IP2mLjnMQ EBw8NoNTpZJ1H10sdV4geiNyR/1VjdNMAfjeld0C6dRx5KvlEoMoaG9qYsy4Dg39S2Y5 4BuCRYTinTy9Wo3RpCIaN9y7l/UjodaUT4OjnpnDVTmC6THfd6O5DTdTBSNGfm+7HEZK 1rBGKDkS0/TQQ1qu5bztGxuyArSSfoo5mI5DXVYQNuVAJ+j7fRB+41pG1RiQvTSQZuH0 H721jpLmbjGSdqFLs4qQpLf9eKzojaN8hofqQHrwPO38S+g/8UxbLK3zWcjeBhQy1O+N a4Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="JWY/+/+C"; 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 jg16-20020a170907971000b008376c09a3e6si10956121ejc.170.2022.12.27.00.14.10; Tue, 27 Dec 2022 00:14:26 -0800 (PST) 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="JWY/+/+C"; 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 S229945AbiL0Hem (ORCPT + 66 others); Tue, 27 Dec 2022 02:34:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiL0Heh (ORCPT ); Tue, 27 Dec 2022 02:34:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B4CE10AF for ; Mon, 26 Dec 2022 23:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672126430; 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=h2F2GH9r8G5/9JPGcKQm0Kg39TfbvH77Y/WP493sark=; b=JWY/+/+CRUIyTNRTfzoCCrxhJHYa/KCLdrUGXBXo8KpzUlGUL9AiC+VMe/HDudvpuu2QQS l9M/6hGF4qZaGDhrlJJIxH89WwIM8b/ZzeB0SLAbdD5YOaGE+Z3W7KehF4gn24BqNBM13q 6r5OnX63mXc/V3hkhBtyVBAqVDeUai8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-219-vu8JubGjMrOLtDsHMkpRXg-1; Tue, 27 Dec 2022 02:33:49 -0500 X-MC-Unique: vu8JubGjMrOLtDsHMkpRXg-1 Received: by mail-wm1-f71.google.com with SMTP id c66-20020a1c3545000000b003d355c13229so9137166wma.0 for ; Mon, 26 Dec 2022 23:33:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=h2F2GH9r8G5/9JPGcKQm0Kg39TfbvH77Y/WP493sark=; b=tXnVqquyjZYsmmdR22yPmk7F/FUY0DS99/5WBUrepTKTx/eeWG5vSifNhKVpeOdCNz ssQAa9JLSHiuEdJqsSWZp1NE60LiU1/RCWLpbc6utYeZ/zEGXDDmCcXNJoa0JSVOR6xC gxKRR2fSfO17bDv02jx4C5q+oDWKFCCGv5Z7qlZvwtg+ZaDp8ZGL07g4fB2uePJm8I2Y 8qF89qYrDVpYLbVJ+F89jacT11JCpyIkVgPYzsCdsTsLHOi8GbGXu+lqE4HjpaEENhnl zmNRlVf2Aww7hy+dyGQuwSW1B2OTeflVq4YhXLu6epTYqZbYOIFq30ywxqfUfcGv1/9p 2CDw== X-Gm-Message-State: AFqh2kqHOw6Zi05AM68T0wOHO+dDdmsgT07j/3hZS1LX+RqnfGUIWgjO rO+XLrGGcttEvCKhPSoBNtSj7Ji57HZHGCxtgTyDPL/TM1BJU8JySVHB3pDT7v93E8hhKhzQfNv WRYGUFOz5u1LNcijDmxjUHVBL X-Received: by 2002:a5d:6849:0:b0:280:70e1:c24f with SMTP id o9-20020a5d6849000000b0028070e1c24fmr2305147wrw.68.1672126428060; Mon, 26 Dec 2022 23:33:48 -0800 (PST) X-Received: by 2002:a5d:6849:0:b0:280:70e1:c24f with SMTP id o9-20020a5d6849000000b0028070e1c24fmr2305128wrw.68.1672126427814; Mon, 26 Dec 2022 23:33:47 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id c17-20020adffb51000000b0027cb20605e3sm5064232wrs.105.2022.12.26.23.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 23:33:47 -0800 (PST) Date: Tue, 27 Dec 2022 02:33:43 -0500 From: "Michael S. Tsirkin" To: Jason Wang Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, maxime.coquelin@redhat.com, alvaro.karsz@solid-run.com, eperezma@redhat.com Subject: Re: [PATCH 3/4] virtio_ring: introduce a per virtqueue waitqueue Message-ID: <20221227022255-mutt-send-email-mst@kernel.org> References: <20221226074908.8154-1-jasowang@redhat.com> <20221226074908.8154-4-jasowang@redhat.com> <20221226183705-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Tue, Dec 27, 2022 at 12:30:35PM +0800, Jason Wang wrote: > > But device is still going and will later use the buffers. > > > > Same for timeout really. > > Avoiding infinite wait/poll is one of the goals, another is to sleep. > If we think the timeout is hard, we can start from the wait. > > Thanks If the goal is to avoid disrupting traffic while CVQ is in use, that sounds more reasonable. E.g. someone is turning on promisc, a spike in CPU usage might be unwelcome. things we should be careful to address then: 1- debugging. Currently it's easy to see a warning if CPU is stuck in a loop for a while, and we also get a backtrace. E.g. with this - how do we know who has the RTNL? We need to integrate with kernel/watchdog.c for good results and to make sure policy is consistent. 2- overhead. In a very common scenario when device is in hypervisor, programming timers etc has a very high overhead, at bootup lots of CVQ commands are run and slowing boot down is not nice. let's poll for a bit before waiting? 3- suprise removal. need to wake up thread in some way. what about other cases of device breakage - is there a chance this introduces new bugs around that? at least enumerate them please. -- MST