Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4606708rwb; Mon, 8 Aug 2022 04:14:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR57CpOr0DiyBOpgjuKFLWFEpf3NxvgB9APD+eFBrZfYvmjsAbL2V0/RreG67bpi0gUtmLwU X-Received: by 2002:a17:903:240f:b0:16d:7865:4b4e with SMTP id e15-20020a170903240f00b0016d78654b4emr18015945plo.82.1659957288533; Mon, 08 Aug 2022 04:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659957288; cv=none; d=google.com; s=arc-20160816; b=ZJqQj/wkUET4mBo4SgKHrke+8n5uohf6v+yOkyZt87siq67kHvcCjsSVI5qUO2ZqTh qpwS6Mn4qRegmj7M2pp+X6j2xuIN3gFKMua1V1BU80NanauM2/lQuK+BmO9THy0NjF7G x1C7Znk/OetErhj85CXqQ3ogTnD2Ygm35ui0oDK2+md1y8EAPLQpGqcDQOAqicVRIO3I UlOlrSGcsqvOtAiiwwbYrtYaKfl8dzaCnnPByD25k2Hyxx0KWEopfbHeG6kDcxtgGyKy JQ4dlAIEalJx6Z9QBPYGkntjUdTzzbAei48/Y4lFeWhgwQpxq8DaOnucdahgvB4aG53f B82A== 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=dqSC8Z4HeQqm883ffB+WsfLf65IQJEdZYAKuOt873gg=; b=R80PY3NTMFcx2Tjoa54VpQUoUtPjQUIQddYi0U2/Jp8nOHglDHndkxyfuwuhK/LyOv fFootgL7gXhnBa09Ko1qkFTSBlzC2RZA0ehnwNrEBNc7vTDjaMXR7byBzBjqFRJUAv5u 3F3M29lFHzA7QccN1XzYFkXH7FTjIwkRdef4J1pTXr2S4eGTQXoO/QuZmZWqlENQDElw NRId9v/WVM6aDFnhfBZf2tVt4sY3ZAPD6ynnUS+NLg7iLgAh34OLKcPrgsJXxko7q4qQ 0tOCDVzxUmalejuHEqnkZUsPbMxdCgfnzE2yIbb+zemg9RowtwkDgJeqHX+4WbW4QaXW BwSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V5YqgD51; 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 w7-20020a170902e88700b0016d785ef6ebsi5391097plg.104.2022.08.08.04.14.31; Mon, 08 Aug 2022 04:14:48 -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=V5YqgD51; 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 S230483AbiHHLCL (ORCPT + 99 others); Mon, 8 Aug 2022 07:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbiHHLCI (ORCPT ); Mon, 8 Aug 2022 07:02:08 -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 EF60B55B8 for ; Mon, 8 Aug 2022 04:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659956526; 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=dqSC8Z4HeQqm883ffB+WsfLf65IQJEdZYAKuOt873gg=; b=V5YqgD51quakaI+m6FGh71cy9/Wf9Pp/sgmrZafpgiGbe8sIYc6HK6lyO4zvBFVHdn/Jra GpdO4B7fE0a1lqHjQW5mFgwvbqov4wbr2k0vOjjA73LhOrBCmiq2WyrDRhWHf/Tvrw+M52 eWUHbJpiiHDCFO83btklU1BGY2cX2YM= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-76-HZVnpXDOOqqipIJ92gqxjg-1; Mon, 08 Aug 2022 07:02:05 -0400 X-MC-Unique: HZVnpXDOOqqipIJ92gqxjg-1 Received: by mail-qt1-f197.google.com with SMTP id ew4-20020a05622a514400b00342eed9a57bso3590918qtb.21 for ; Mon, 08 Aug 2022 04:02:05 -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:cc:to:from:date:x-gm-message-state:from:to:cc; bh=dqSC8Z4HeQqm883ffB+WsfLf65IQJEdZYAKuOt873gg=; b=0CmSZcX+KSWWXeFNeXbrOvDk5RbmYMohkY3Jcee6R87HkFo0mSj4qYx9LLXvJpA9hc fI9JcMCkYjAbCOBUOnkw/vLjqLKTkVNLkNVXwyx3wW7Acy8qSI+7p6zhWyo32MuCdh/M 64WlineRItO/i9JjFydA04284Re/lL2TYpc7HV+FB6pDLSc9TLFvL6i1dn0tA4Uf2WGP mYCIKl1BQBcKz86if8F8StQC/KD1PZlBZoPTSzU89osMD0IguV2+Ee5V55DaOQHTGSsC Tg8puZHxbUjGvAWFIPrZvkxdQyRTkytfOxYTNJpO5ZPv98ardU2OVNwFQjOkTdSgKrhN IMOw== X-Gm-Message-State: ACgBeo16gkb67/zE0OlRb6YiuSBtAWBYzJKFttonOX+vPPpaiEUA4/Gg 10FI0unzSFeZLzaCyGxq+nTYklKxZVbv54MpTHFUrA12hdkEtNNPd+X2b+I2zLO6B7ARS0qLq09 fk7AfKwMj0LWY2IlCFP7VfGsN X-Received: by 2002:a05:6214:20e8:b0:47a:e5b6:bcb3 with SMTP id 8-20020a05621420e800b0047ae5b6bcb3mr7619241qvk.38.1659956524321; Mon, 08 Aug 2022 04:02:04 -0700 (PDT) X-Received: by 2002:a05:6214:20e8:b0:47a:e5b6:bcb3 with SMTP id 8-20020a05621420e800b0047ae5b6bcb3mr7619210qvk.38.1659956524067; Mon, 08 Aug 2022 04:02:04 -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 u12-20020a05620a454c00b006b928ba8989sm885511qkp.23.2022.08.08.04.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 04:02:03 -0700 (PDT) Date: Mon, 8 Aug 2022 13:01:53 +0200 From: Stefano Garzarella To: Arseniy Krasnov , Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers 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 , Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers , 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 v3 8/9] vmci/vsock: check SO_RCVLOWAT before wake up reader Message-ID: <20220808110153.fkxwwqbbqxz7wvgw@sgarzare-redhat> References: <2ac35e2c-26a8-6f6d-2236-c4692600db9e@sberdevices.ru> <5b7e133e-f8e1-1f71-9a3c-ac0265cffb63@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <5b7e133e-f8e1-1f71-9a3c-ac0265cffb63@sberdevices.ru> 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,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 Wed, Aug 03, 2022 at 02:05:52PM +0000, Arseniy Krasnov wrote: >This adds extra condition to wake up data reader: do it only when number >of readable bytes >= SO_RCVLOWAT. Otherwise, there is no sense to kick >user,because it will wait until SO_RCVLOWAT bytes will be dequeued. Ditto as previous patch. @Bryan, @Vishnu, plaese, can you review/ack also this patch? Thanks, Stefano > >Signed-off-by: Arseniy Krasnov >--- > net/vmw_vsock/vmci_transport_notify.c | 2 +- > net/vmw_vsock/vmci_transport_notify_qstate.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c >index 852097e2b9e6..7c3a7db134b2 100644 >--- a/net/vmw_vsock/vmci_transport_notify.c >+++ b/net/vmw_vsock/vmci_transport_notify.c >@@ -307,7 +307,7 @@ vmci_transport_handle_wrote(struct sock *sk, > struct vsock_sock *vsk = vsock_sk(sk); > PKT_FIELD(vsk, sent_waiting_read) = false; > #endif >- sk->sk_data_ready(sk); >+ vsock_data_ready(sk); > } > > static void vmci_transport_notify_pkt_socket_init(struct sock *sk) >diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c >index 12f0cb8fe998..e96a88d850a8 100644 >--- a/net/vmw_vsock/vmci_transport_notify_qstate.c >+++ b/net/vmw_vsock/vmci_transport_notify_qstate.c >@@ -84,7 +84,7 @@ vmci_transport_handle_wrote(struct sock *sk, > bool bottom_half, > struct sockaddr_vm *dst, struct sockaddr_vm *src) > { >- sk->sk_data_ready(sk); >+ vsock_data_ready(sk); > } > > static void vsock_block_update_write_window(struct sock *sk) >@@ -282,7 +282,7 @@ vmci_transport_notify_pkt_recv_post_dequeue( > /* See the comment in > * vmci_transport_notify_pkt_send_post_enqueue(). > */ >- sk->sk_data_ready(sk); >+ vsock_data_ready(sk); > } > > return err; >-- >2.25.1