[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bc6328cf-ddf8-5e7c-31d9-ea346c81c5b0@sberdevices.ru>
Date: Thu, 28 Jul 2022 06:04:25 +0000
From: Arseniy Krasnov <AVKrasnov@...rdevices.ru>
To: Stefano Garzarella <sgarzare@...hat.com>
CC: "David S. Miller" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
"kys@...rosoft.com" <kys@...rosoft.com>,
"haiyangz@...rosoft.com" <haiyangz@...rosoft.com>,
"sthemmin@...rosoft.com" <sthemmin@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"Dexuan Cui" <decui@...rosoft.com>,
Stefan Hajnoczi <stefanha@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Krasnov Arseniy <oxffffaa@...il.com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
kernel <kernel@...rdevices.ru>
Subject: Re: [RFC PATCH v2 1/9] vsock: use sk_rcvlowat to set
POLLIN/POLLRDNORM
On 27.07.2022 15:17, Stefano Garzarella wrote:
> 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).
Ok, i see. Ack
>
> Thanks,
> Stefano
>
>> Signed-off-by: Arseniy Krasnov <AVKrasnov@...rdevices.ru>
>> ---
>> 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
>
Powered by blists - more mailing lists