Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1259382lqa; Mon, 29 Apr 2024 03:18:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWibys2Cr3Y9aVeDgdpwEdWPtk80HOqaEtmptxYgqRGcm+f3U9FKy3Lc7XDukPFSLB8tc3Z4Uj5hB9tmCLukPHt9J+ZvSBXPnMa51ev6g== X-Google-Smtp-Source: AGHT+IFu0LwMvvwB/zaUxwRnwQnMaLUDbvavc+ld+sEBwav8LA4VyI+qUUGysjI4T6bB7gVQN0Do X-Received: by 2002:a05:622a:84:b0:43a:bd92:6ad4 with SMTP id o4-20020a05622a008400b0043abd926ad4mr5012645qtw.46.1714385906544; Mon, 29 Apr 2024 03:18:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714385906; cv=pass; d=google.com; s=arc-20160816; b=O/j4eLxJ0iRIiK2YhDu5sMPrdL9J1jMxzuQgEtlevaJmj5GKqlh9IgzsuYAho5F042 g4pxs6gcIUWLgBa88l3oOCb2xW3Xyd8XLHbgCYAtoomWL0lCT+XdhC2MAI1JQCjhpzG7 VZva7pYZgdQ8iM7Pzdh7ygZM6G0G859VNUefvnneul3HEeni0oUfDLbR+yMZkHf7BTkT lbc00oUEFZX1VOReL3RN60hftDj+Oy3V7/6/qm5uuSP+M+eFpiwSetmIa6cWJUQSoThv ceYKVotcSoNW7QRnDD0xzrPTiSOZGvH3MamIDKSqP0c0RhsFey06WphU4vnJKOiu50Hh zw9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=U3aeDuQ2ScmwkduPqNuDpZ1kq3jr/gZ/7h6UWkDfJo4=; fh=Y7UtyiFJ54NcD7EGYvQSjdDy6io1CHbyonNVCXg3oI8=; b=TGGDC9snODf9YwMyA/xPGNGeDS3tppD6WuWpcxTbRLAXnU7DJew15VRuIo+mPKPm60 frBhSnNu3Grd75Y5hwM6XbYnensMCreK2ML3914K06M7TCeWWnaVJmjMMwh7B6GzIRu2 qAvpou0u0VRyRX82VsUd+mAEw8xYwNBWlAjn5BXwYjtUzWqR7bITo5wtQZpm2QvQJIL5 Qs5bvwodtOv5TNIO5beR50qin6OMH3lPVqelCW8t4doKMUE9b6Re9thyopWwr+qn1ob9 EQWiS/qzJpuc2PQyStIx7UgKOLOiu5hEmvdmww/YViOxMNEtTQdgAw/ZThGkppaAZsdX guNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fL+hftWD; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-162034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id er15-20020a05622a5e8f00b0043784e9d69dsi19367745qtb.496.2024.04.29.03.18.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:18:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fL+hftWD; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-162034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4856D1C2192F for ; Mon, 29 Apr 2024 10:18:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A36D39852; Mon, 29 Apr 2024 10:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fL+hftWD" 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 1647A2C19D for ; Mon, 29 Apr 2024 10:18:07 +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=1714385889; cv=none; b=e7fcmZdWldImDDf2vb2C9QQbvc4YCuCWhd32XWBI7qL4/2TM6+Hi3yS7dYiYNu8hrlCBnKS1es06+puZT+LiHGcn2flGYmsJE5vNZacrrYe/WkQFQYFcwPHs4RihbLGslWMNUT8hKQHMM+flZ/53nvVWoxsCzpp21N0FCepY8vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714385889; c=relaxed/simple; bh=Dp4WhcAEm3LjoebX3QhKlSxpYfp26vcYnT3xltjPvdc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uCGUi1Z6wEORIirA41zzKPMA07c/vpaHQ9tZgqWN9YE7/R2KxRAHHY5RUVI7rocLcAIyzpLjjaN6FwVcHQfbquA14LE1B6Rq/aFXd82jxDladb+/2WWRp9VzdHQnFpy05bPEFlXmRCrykqSRx5MfszWGJNwIJKsN+G0/atDGe/g= 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=fL+hftWD; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714385886; 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=U3aeDuQ2ScmwkduPqNuDpZ1kq3jr/gZ/7h6UWkDfJo4=; b=fL+hftWDo4reqtaDorl3jcfhFpHAJqQxFWgW4ti8G25hefsqv8cGst1friQWehXroDjJIB oKPNUQQu291hjUGhtSO+24dDovRGGDwmEUxYgBzmb7cVDDmKTQUhAk1WS0XwNJMfBUB7Ab V1mIT9U9Pd1LVwm5F9wbW6JL+kEOZqY= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-rh4CZOlCNQaiYCt-RUNZiA-1; Mon, 29 Apr 2024 06:18:05 -0400 X-MC-Unique: rh4CZOlCNQaiYCt-RUNZiA-1 Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-6f3eb28c129so1042218b3a.1 for ; Mon, 29 Apr 2024 03:18:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714385884; x=1714990684; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U3aeDuQ2ScmwkduPqNuDpZ1kq3jr/gZ/7h6UWkDfJo4=; b=WEaVIoMKWXSAYeXQYudKz4Uej4StFBOFtwpksLAw/IOqmnKw9NcNd0YhNZAB5wn0rk tpuHeET3ZRt3Vzd/3dBNVBJQWEPkoX3GnGvzgMoBy3UhDD/bjKugNmyiW/NGnP5nDXnP LKtmc4WwY9Xsj1rabUuvbRnAj933HiejmxLOBqSC25AR5E1H4ywKCcBJ9MGnA/tI2P8t Yj1dFBW1SKKEedv+kdVs6lFYC5MIr52afKWl5yLqvqdI8g6cvHFyLYR6ewTxFg5EhHw5 OstBG93e9DIkwlT4XIVXOj4kqaM0mSrDFQwzW4I0JbUltKnXkEKpFUpllQim6ITKW+EM ItcA== X-Forwarded-Encrypted: i=1; AJvYcCWzeelGmfdqTd62YxZ288ks2ZRIoORDWd5ZxYArgJnG2t+UFD8KrJ/WGyCi1WMXYMhTCAbLjwdtFcmodddc2AzijpRr/kfyL8eAJIdq X-Gm-Message-State: AOJu0Yy+dCK5QAbXTBkC35weGQFtufx95HcOSsdsGljIn+MIPhc4v5sZ VYZqRCJ7K28Wu4ySypTEiuRr0lwD9yp+WqsMSlZWh/Bo2rwhxLkI33Q0oBoK6Ink7QwyBVNqT53 PEQH0FxXOGHnUy7BdSGm8AKoRKnqg/o1SlyqZFLrF7WIkGmoj5qasOdgf5GV3hj76S7TkJw== X-Received: by 2002:a05:6a00:181a:b0:6f0:28a4:a871 with SMTP id y26-20020a056a00181a00b006f028a4a871mr12925343pfa.19.1714385883780; Mon, 29 Apr 2024 03:18:03 -0700 (PDT) X-Received: by 2002:a05:6a00:181a:b0:6f0:28a4:a871 with SMTP id y26-20020a056a00181a00b006f028a4a871mr12925319pfa.19.1714385883454; Mon, 29 Apr 2024 03:18:03 -0700 (PDT) Received: from [192.168.68.50] ([43.252.112.88]) by smtp.gmail.com with ESMTPSA id a15-20020aa780cf000000b006f0830a298dsm18919959pfn.156.2024.04.29.03.18.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Apr 2024 03:18:02 -0700 (PDT) Message-ID: Date: Mon, 29 Apr 2024 20:17:57 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] vhost: Cleanup Content-Language: en-US To: "Michael S. Tsirkin" Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, jasowang@redhat.com, shan.gavin@gmail.com References: <20240423032407.262329-1-gshan@redhat.com> <20240429025750-mutt-send-email-mst@kernel.org> From: Gavin Shan In-Reply-To: <20240429025750-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/29/24 17:02, Michael S. Tsirkin wrote: > On Tue, Apr 23, 2024 at 01:24:03PM +1000, Gavin Shan wrote: >> This is suggested by Michael S. Tsirkin according to [1] and the goal >> is to apply smp_rmb() inside vhost_get_avail_idx() if needed. With it, >> the caller of the function needn't to worry about memory barriers. Since >> we're here, other cleanups are also applied. > > > Gavin I suggested another approach. > 1. Start with the patch I sent (vhost: order avail ring reads after > index updates) just do a diff against latest. > simplify error handling a bit. > 2. Do any other cleanups on top. > My apologies, Michael. I didn't see your patch until now [1] [1] https://lore.kernel.org/virtualization/20240327155750-mutt-send-email-mst@kernel.org/ v2 was sent with your changes integrated and other cleanup are applied on top of it. Please take a look when you getting a chance. v2: https://lore.kernel.org/virtualization/20240429101400.617007-1-gshan@redhat.com/T/#t Thanks, Gavin