Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp254913imn; Wed, 27 Jul 2022 05:29:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvWhogXqKI4EJwr7lIuA3nXl0ZNxo+xbO1vDq90WEJSLt/FpjICaCoyAXc14cXgDgDuCIr X-Received: by 2002:a17:907:2c44:b0:72b:6160:c64c with SMTP id hf4-20020a1709072c4400b0072b6160c64cmr18000379ejc.55.1658924962761; Wed, 27 Jul 2022 05:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658924962; cv=none; d=google.com; s=arc-20160816; b=Vv0Y6Oiu9XCSTH7zk4ONrP7oHfe+3Vw6tFAfPLWhp8WEoh0kYXWiKDPpM/yKauTLLy G69g8Uc8ztstvUrn2n9lc15+JWkO8WubGVKWLnjoCdVyIcX1CqMe63uO/y61ZQrLJnPS q85ZDNPi75oA604sGPrtd7DFP7qakgLjB8AKKrSV7RDIyaKybntTRuXnEpxPvb2TD0Vo Tj8Wz1ORJunyoCXV8lHbOH28Gbx/Rx3tTtsY7WD8lQrBD16iksULo00Lzh5avCiBHHDy e1U6D8v1bg0/IkNrZ/pwnowxaBvC+TaxSw13oIyeipXYfJJu7/dD+e2iyWLtS2C1wL4Z sRPA== 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=4rTHmFps6imtrmSGc8bdiFcqdRJQxILQMWRRFRNlZ68=; b=a585DD/ubHA5Brd649tgQYtcRG1AHT6K1ih+GHWGJYn1ekk3fhqU58E3LxV4eMb3KH nGEMt8YVFWyNXOsj2rJEuLntHLqewXybETGTTtvJNyPHfwHxdhwZ+Gy8C5t5+URdXK5v FOpqblEErbB0Z1m/vbFkUNKGKhFzIPo8fEnS1MT3kqjU1kNsKsvgrdCzErNNz8RIlLnU CqCYsKNL1wS87vacSaXIvKzcMjaG6nB469/NB0BAaJxWd7v1V9xA4fHGJ6jLk8mXRhd8 1/NyauGfNRizsRVfZ7SzbJSGkkbOrN50nggGl6JuIiQ/rlJCawHV266yBQMJP8YbGlLf sPDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KuixpPNW; 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 w19-20020a1709062f9300b0072a47c55a12si16148441eji.360.2022.07.27.05.28.57; Wed, 27 Jul 2022 05:29:22 -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=KuixpPNW; 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 S232818AbiG0MRX (ORCPT + 99 others); Wed, 27 Jul 2022 08:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232827AbiG0MRU (ORCPT ); Wed, 27 Jul 2022 08:17:20 -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 ESMTP id BDCF14AD51 for ; Wed, 27 Jul 2022 05:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658924237; 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=4rTHmFps6imtrmSGc8bdiFcqdRJQxILQMWRRFRNlZ68=; b=KuixpPNWOHqiK7BSiaMgrOKSInQUKlXE/c4zordjG+PmUWUqjuk/FUAbXU3zNXxHYFsgu8 tjzkCmmNVZsWtvQQWjzRhc1BfsvCjP365VsqlZRom80pevoa3lfB2pKnnD59IT1jTTwZ7C gqtKz6tuctaODSKgv0FFVwdO2vT/OUI= 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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-MB6UoQnMOR2jD_XogMBxKg-1; Wed, 27 Jul 2022 08:17:16 -0400 X-MC-Unique: MB6UoQnMOR2jD_XogMBxKg-1 Received: by mail-wm1-f71.google.com with SMTP id n19-20020a05600c3b9300b003a314062cf4so1828654wms.0 for ; Wed, 27 Jul 2022 05:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4rTHmFps6imtrmSGc8bdiFcqdRJQxILQMWRRFRNlZ68=; b=6garPBJLf49GX2PJr8cctfX9Bm7r+SwjArOnFE8ZRa99GXBAFlHZxRKalaNgHaHrQk s6w8XqwFBmEMpXHNh+GkOfKvUdKcdfWUvLWYK/nGCIHSRPuhoHQ/88NLl1rA6Mp1Nlxj EzsTmzSQxt5qHqqzrRdLNX7nCaeKhHWQhj8aX6nK6bpOK3dor85z88OxG3Qjdfv2up2Q Cdr0goznpDYsl9XqBgU6OU6SjxMFDPlqnDqRUOSJsr04Yg2RaEDO3Vcai8SC9+5ktEA/ k/I3MMNz/v/+THAGnBZyVCAZjzZ9th4GDtBEg+lZwNdBu4oHZzUWov2bMgqbTD2C4tfi d+Ng== X-Gm-Message-State: AJIora9fvcg7pufaC6Kt95xA1D9LjFDT1T/ISaQZY1MbNx0W9+33ilrU m4OYLFt1IWtzqpCZd60YAKbegWoJxGsu6SCba6fReQ/+VNB8aawEaQMJsCKi8jP7pcVtUHqT9yG jfd7BPinmX03ZcdyN/yVKOlqu X-Received: by 2002:a5d:5252:0:b0:21e:6e28:a6da with SMTP id k18-20020a5d5252000000b0021e6e28a6damr12304199wrc.100.1658924235600; Wed, 27 Jul 2022 05:17:15 -0700 (PDT) X-Received: by 2002:a5d:5252:0:b0:21e:6e28:a6da with SMTP id k18-20020a5d5252000000b0021e6e28a6damr12304167wrc.100.1658924235252; Wed, 27 Jul 2022 05:17:15 -0700 (PDT) Received: from sgarzare-redhat (host-79-46-200-178.retail.telecomitalia.it. [79.46.200.178]) by smtp.gmail.com with ESMTPSA id u9-20020adff889000000b0020fcaba73bcsm16713440wrp.104.2022.07.27.05.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 05:17:14 -0700 (PDT) Date: Wed, 27 Jul 2022 14:17:09 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: "David S. Miller" , "edumazet@google.com" , Jakub Kicinski , Paolo Abeni , "kys@microsoft.com" , "haiyangz@microsoft.com" , "sthemmin@microsoft.com" , "wei.liu@kernel.org" , Dexuan Cui , Stefan Hajnoczi , "Michael S. Tsirkin" , Krasnov Arseniy , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "kvm@vger.kernel.org" , kernel Subject: Re: [RFC PATCH v2 1/9] vsock: use sk_rcvlowat to set POLLIN/POLLRDNORM Message-ID: <20220727121709.z26dspwegqeiv55x@sgarzare-redhat> References: <19e25833-5f5c-f9b9-ac0f-1945ea17638d@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.7 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 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, Jul 25, 2022 at 07:56:59AM +0000, Arseniy Krasnov wrote: >Both bits indicate, that next data read call won't be blocked, but when >sk_rcvlowat is not 1, these bits will be set by poll anyway, thus when >user tries to dequeue data,it will wait until sk_rcvlowat bytes of data >will be available. > The patch LGTM, but I suggest you to rewrite the title and commit of the message to better explain what this patch does (pass sock_rcvlowat to notify_poll_in as target) and then explain why as you already did (to set POLLIN/POLLRDNORM only when target is reached). Thanks, Stefano >Signed-off-by: Arseniy Krasnov >--- > net/vmw_vsock/af_vsock.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index f04abf662ec6..63a13fa2686a 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -1066,8 +1066,9 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, > if (transport && transport->stream_is_active(vsk) && > !(sk->sk_shutdown & RCV_SHUTDOWN)) { > bool data_ready_now = false; >+ int target = sock_rcvlowat(sk, 0, INT_MAX); > int ret = transport->notify_poll_in( >- vsk, 1, &data_ready_now); >+ vsk, target, &data_ready_now); > if (ret < 0) { > mask |= EPOLLERR; > } else { >-- >2.25.1