Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2638811rwb; Mon, 15 Aug 2022 08:46:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR4h7tE4LJKEvoVhELrSQNO6Y9v7WY/Q1nbYvIz5ap/Qx9RprtaYnbmFbm/uX/TAACO/1YFZ X-Received: by 2002:a17:907:72d0:b0:734:b451:c8d9 with SMTP id du16-20020a17090772d000b00734b451c8d9mr10603828ejc.272.1660578390415; Mon, 15 Aug 2022 08:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660578390; cv=none; d=google.com; s=arc-20160816; b=V7BNsSAgxy9/svu4uX71d95GWf/rADxjdFHgtmjUvVnrhjeRCYNrg/BfJie2daCzZJ 13p4rtIbVFmJAOBzAWOixsgud3xK6jJToFcFMjBdbr9A9H0O/Vb+HqlVnDs5aHWoc4K/ LbxorHoeZxUw5SfPBKfxoZPy+9LpL3CIC7rPd9h8xn+vszeddkNbaErUD/7/KGdHuf6u DQv/zeG+dTZf7gVCCIDzBOwzl6MpFG/2Zurn0cUD5CXZIJpRbbSFH6WFeOe5h0hBqEMk gz45kQ2SRLOlMTJlO9X6s4MLTL+YC5uV22CTpY1YDij34SxMwPGzZilBQZF463ydb1JJ EHtA== 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:to:from:date:dkim-signature; bh=UpOQ0S8xTyMJHmMY1t7J4us9+LjsWwhrGGsgao9tXgo=; b=Doh/Z2qdmv3t34nJowkZ+LKnR8lQ+lzS939mWbrzX/hlyFrHwjBrDCvsAFQs0bpAVm Tm8QWJPzuGPSn/1fOpRNy13a5rFlo6ab8OFvBDuA14304XgPLSwr1WqfFjmKvh27FIwW 5ojlv0/HqwS+MSadGB/ow/DITeTxV3bGhSuSI+EbXU1AvwL1Gmx8fYpIoeR7Gr/4zkXb zLrIqQ4bQaiflmshSbEiW6ys75eaiQn2RrTPPoh2R0OjSlU89tA84U1ZbRAk7p+dKTGR bdmcx86b4DZRLFxyg9y5ng6O10u9ixcaen1GDK38avHOnua3yvDbSXja1sTR9H9WsqQG 2gZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G4MBLOMk; 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 f16-20020a056402355000b0043ddebb56a0si8754417edd.61.2022.08.15.08.46.02; Mon, 15 Aug 2022 08:46:30 -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=G4MBLOMk; 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 S232391AbiHOPlW (ORCPT + 99 others); Mon, 15 Aug 2022 11:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232227AbiHOPlL (ORCPT ); Mon, 15 Aug 2022 11:41:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 44117654C for ; Mon, 15 Aug 2022 08:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660578068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UpOQ0S8xTyMJHmMY1t7J4us9+LjsWwhrGGsgao9tXgo=; b=G4MBLOMk8R9vNqqr+pwIRgrCwrglo0twW0J57jyjUpGZ3nHa9sh5qXIJeSkzo12bMBddb9 +T+svhcI/xvn8Dg/cxpKg7h3lsEZV2Ab9UzhvFiGrkLhUv3EYyZOBTCAP/qM7/VeaZJBHw FboBBveih6+/W89RjB7x+4H7+GPvXJc= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-517-R6wWYIVbNoaQYHBhs7q_mQ-1; Mon, 15 Aug 2022 11:41:07 -0400 X-MC-Unique: R6wWYIVbNoaQYHBhs7q_mQ-1 Received: by mail-ed1-f69.google.com with SMTP id v19-20020a056402349300b0043d42b7ddefso4897231edc.13 for ; Mon, 15 Aug 2022 08:41:07 -0700 (PDT) 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:to:from:date:x-gm-message-state:from:to:cc; bh=UpOQ0S8xTyMJHmMY1t7J4us9+LjsWwhrGGsgao9tXgo=; b=K0nVV+ZBgTNuK20taKwE2EgWbB2ocIOw+bXCKd3/IIH6filNET4Trrwm9UfOl6HG+E Y5SvAzIxpbLjIjdIHVonjFWIb3Zr/xmW1iEhESIZlj7/iPFp3lykIV2rdsXsIU8puklW ZjtFmGkwAhu20ICHd2ZiRwfSx654oMHJZWLGStxsxI24okMPFbySMd5ta0dQzmnClnNm jqy2bP4cCZ7GRy0tbM5cZmczX7qX5FvUva9aSbYvmPN2cmoe/5cZhFdQwDs/nNp/H0n2 dSOtNgacRyWkb0/U8EOoi2sFRQ7Q+9fc+pjyX2c1V+KlKu2eGytQWnQe34bTdRLYEUTO EJ/g== X-Gm-Message-State: ACgBeo2icW7757RpbMsr6vGFWfBcmWrAbkNmRDwIPVhqZvpcwtZjO3Bp ILsu5Qgr+HO+v81M83KSHNjW2+5RO02yg2+kjP2REsfCWpZJ6msQ4OjUcIHU20SPParX/nHDI61 dQ1EV9TCwCQNMtkRf3X2eerF4 X-Received: by 2002:a05:6402:254b:b0:43e:7c6a:f431 with SMTP id l11-20020a056402254b00b0043e7c6af431mr15419042edb.305.1660578066087; Mon, 15 Aug 2022 08:41:06 -0700 (PDT) X-Received: by 2002:a05:6402:254b:b0:43e:7c6a:f431 with SMTP id l11-20020a056402254b00b0043e7c6af431mr15419032edb.305.1660578065916; Mon, 15 Aug 2022 08:41:05 -0700 (PDT) Received: from redhat.com ([2.54.169.49]) by smtp.gmail.com with ESMTPSA id kd1-20020a17090798c100b007262a1c8d20sm4248334ejc.19.2022.08.15.08.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 08:41:05 -0700 (PDT) Date: Mon, 15 Aug 2022 11:40:59 -0400 From: "Michael S. Tsirkin" To: Xuan Zhuo , Jason Wang , Andres Freund , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Linus Torvalds , Jens Axboe , James Bottomley , "Martin K. Petersen" , Guenter Roeck , linux-kernel@vger.kernel.org, Greg KH , c@redhat.com Subject: Re: upstream kernel crashes Message-ID: <20220815113729-mutt-send-email-mst@kernel.org> References: <20220814223743.26ebsbnrvrjien4f@awork3.anarazel.de> <1c057afa-92df-ee3c-5978-3731d3db9345@kernel.dk> <20220815013651.mrm7qgklk6sgpkbb@awork3.anarazel.de> <20220815071143.n2t5xsmifnigttq2@awork3.anarazel.de> <20220815034532-mutt-send-email-mst@kernel.org> <20220815081527.soikyi365azh5qpu@awork3.anarazel.de> <20220815042623-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.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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 Mon, Aug 15, 2022 at 01:34:41AM -0700, Andres Freund wrote: > Hi, > > On August 15, 2022 1:28:29 AM PDT, "Michael S. Tsirkin" wrote: > >On Mon, Aug 15, 2022 at 01:15:27AM -0700, Andres Freund wrote: > >> Hi, > >> > >> On 2022-08-15 03:51:34 -0400, Michael S. Tsirkin wrote: > >> > It is possible that GCP gets confused if ring size is smaller than the > >> > device maximum simply because no one did it in the past. > >> > > >> > So I pushed just the revert of 762faee5a267 to the test branch. > >> > Could you give it a spin? > >> > >> Seems to fix the issue, at least to the extent I can determine at 1am... :) > >> > >> Greetings, > >> > >> Andres Freund > > > >So you tested this: > > > >commit 13df5a7eaeb22561d39354b576bc98a7e2c389f9 (HEAD, kernel.org/test) > >Author: Michael S. Tsirkin > >Date: Mon Aug 15 03:44:38 2022 -0400 > > > > Revert "virtio_net: set the default max ring size by find_vqs()" > > > > This reverts commit 762faee5a2678559d3dc09d95f8f2c54cd0466a7. > > > > Signed-off-by: Michael S. Tsirkin > > > >and it fixes both issues right? No crashes no networking issue? > > Correct. I only did limited testing, but it's survived far longer / more reboots than anything since the commit. > > Andres > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. OK so this gives us a quick revert as a solution for now. Next, I would appreciate it if you just try this simple hack. If it crashes we either have a long standing problem in virtio code or more likely a gcp bug where it can't handle smaller rings than what device requestes. Thanks! diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index f7965c5dd36b..bdd5f481570b 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -314,6 +314,9 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev, if (!size || size > num) size = num; + if (size > 1024) + size = 1024; + if (size & (size - 1)) { dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u", size); return ERR_PTR(-EINVAL); -- MST