Re: [PATCH] docs: Correct the default thread-pool-size

2022-05-05 Thread liuyd.f...@fujitsu.com
Gently ping


On 4/27/22 9:12 AM, liuyd.f...@fujitsu.com wrote:
> [+cc qemu-trivial]
>
> On 4/14/22 8:19 PM, Vivek Goyal wrote:
>> On Wed, Apr 13, 2022 at 12:20:54PM +0800, Liu Yiding wrote:
>>> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default
>>>
>>> Signed-off-by: Liu Yiding 
>> Looks good. Our default used to be --thread-pool-size=64. But we changed
>> it to using no thread pool because on lower end of workloads it performed
>> better. When multiple threads are doing parallel I/O then, thread pool
>> helps. So people who want to do lots of parallel I/O should manually
>> enable thread pool.
>>
>> Acked-by: Vivek Goyal 
>>
>> Vivek
>>> ---
>>>docs/tools/virtiofsd.rst | 2 +-
>>>1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
>>> index 0c0560203c..33fed08c6f 100644
>>> --- a/docs/tools/virtiofsd.rst
>>> +++ b/docs/tools/virtiofsd.rst
>>> @@ -127,7 +127,7 @@ Options
>>>.. option:: --thread-pool-size=NUM
>>>
>>>  Restrict the number of worker threads per request queue to NUM.  The 
>>> default
>>> -  is 64.
>>> +  is 0.
>>>
>>>.. option:: --cache=none|auto|always
>>>
>>> -- 
>>> 2.31.1
>>>
>>>
>>>
>>>
-- 
Best Regards.
Yiding Liu


Re: [Virtio-fs] [PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

2022-08-18 Thread liuyd.f...@fujitsu.com
It works. I tested on RHEL8
Before this fix:
```
# /root/qemu/build/tools/virtiofsd/virtiofsd --socket-path=/tmp/sock -o 
source=/home/test -d

[(null)] [ID: 00133152] virtio_session_mount: Waiting for vhost-user 
socket connection...


```

After applying this patch
```
# /root/qemu/build/tools/virtiofsd/virtiofsd --socket-path=/tmp/sock -o 
source=/home/test -d

[2022-08-19 01:45:41.981608+] [ID: 00134587] virtio_session_mount: 
Waiting for vhost-user socket connection...

``` 


On 8/19/22 01:46, Yusuke Okada wrote:
> The "%f" specifier in g_date_time_format() is only available in glib
> 2.65.2 or later. If combined with older glib, the function returns null
> and the timestamp displayed as "(null)".
> 
> For backward compatibility, g_date_time_get_microsecond should be used
> to retrieve subsecond.
> 
> In this patch the g_date_time_format() leaves subsecond field as "%06d"
> and let next snprintf to format with g_date_time_get_microsecond.
> 
> Signed-off-by: Yusuke Okada 
> ---
>   tools/virtiofsd/passthrough_ll.c | 7 +--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virtiofsd/passthrough_ll.c 
> b/tools/virtiofsd/passthrough_ll.c
> index 371a7bead6..20f0f41f99 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -4185,6 +4185,7 @@ static void setup_nofile_rlimit(unsigned long 
> rlimit_nofile)
>   static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
>   {
>   g_autofree char *localfmt = NULL;
> +char buf[64];
>   
>   if (current_log_level < level) {
>   return;
> @@ -4197,9 +4198,11 @@ static void log_func(enum fuse_log_level level, const 
> char *fmt, va_list ap)
>  fmt);
>   } else {
>   g_autoptr(GDateTime) now = g_date_time_new_now_utc();
> -g_autofree char *nowstr = g_date_time_format(now, "%Y-%m-%d 
> %H:%M:%S.%f%z");
> +g_autofree char *nowstr = g_date_time_format(now,
> +   "%Y-%m-%d %H:%M:%S.%%06d%z");
> +snprintf(buf, 64, nowstr, g_date_time_get_microsecond(now));
>   localfmt = g_strdup_printf("[%s] [ID: %08ld] %s",
> -   nowstr, syscall(__NR_gettid), fmt);
> +   buf, syscall(__NR_gettid), fmt);
>   }
>   fmt = localfmt;
>   }

-- 
Thanks,
Yiding

Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-13 Thread liuyd.f...@fujitsu.com
[+cc vgo...@redhat.com]

On 4/13/22 12:20 PM, Liu Yiding wrote:
> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default
>
> Signed-off-by: Liu Yiding 
> ---
>   docs/tools/virtiofsd.rst | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
> index 0c0560203c..33fed08c6f 100644
> --- a/docs/tools/virtiofsd.rst
> +++ b/docs/tools/virtiofsd.rst
> @@ -127,7 +127,7 @@ Options
>   .. option:: --thread-pool-size=NUM
>   
> Restrict the number of worker threads per request queue to NUM.  The 
> default
> -  is 64.
> +  is 0.
>   
>   .. option:: --cache=none|auto|always
>   

-- 
Best Regards.
Yiding Liu


Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-14 Thread liuyd.f...@fujitsu.com
[+cc dgilb...@redhat.com stefa...@redhat.com]

On 4/14/22 1:05 PM, liuyd.f...@fujitsu.com wrote:
> [+cc vgo...@redhat.com]
>
> On 4/13/22 12:20 PM, Liu Yiding wrote:
>> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default
>>
>> Signed-off-by: Liu Yiding 
>> ---
>>docs/tools/virtiofsd.rst | 2 +-
>>1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
>> index 0c0560203c..33fed08c6f 100644
>> --- a/docs/tools/virtiofsd.rst
>> +++ b/docs/tools/virtiofsd.rst
>> @@ -127,7 +127,7 @@ Options
>>.. option:: --thread-pool-size=NUM
>>
>>  Restrict the number of worker threads per request queue to NUM.  The 
>> default
>> -  is 64.
>> +  is 0.
>>
>>.. option:: --cache=none|auto|always
>>

-- 
Best Regards.
Yiding Liu


Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-21 Thread liuyd.f...@fujitsu.com
Hi, Stefan

Please help review it. I'm sorry that I forgot to add you to the 
recipient 😅

On 4/14/22 8:19 PM, Vivek Goyal wrote:
> On Wed, Apr 13, 2022 at 12:20:54PM +0800, Liu Yiding wrote:
>> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default
>>
>> Signed-off-by: Liu Yiding 
> Looks good. Our default used to be --thread-pool-size=64. But we changed
> it to using no thread pool because on lower end of workloads it performed
> better. When multiple threads are doing parallel I/O then, thread pool
> helps. So people who want to do lots of parallel I/O should manually
> enable thread pool.
>
> Acked-by: Vivek Goyal 
>
> Vivek
>> ---
>>   docs/tools/virtiofsd.rst | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
>> index 0c0560203c..33fed08c6f 100644
>> --- a/docs/tools/virtiofsd.rst
>> +++ b/docs/tools/virtiofsd.rst
>> @@ -127,7 +127,7 @@ Options
>>   .. option:: --thread-pool-size=NUM
>>   
>> Restrict the number of worker threads per request queue to NUM.  The 
>> default
>> -  is 64.
>> +  is 0.
>>   
>>   .. option:: --cache=none|auto|always
>>   
>> -- 
>> 2.31.1
>>
>>
>>
>>
-- 
Best Regards.
Yiding Liu


Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-26 Thread liuyd.f...@fujitsu.com
[+cc qemu-trivial]

On 4/14/22 8:19 PM, Vivek Goyal wrote:
> On Wed, Apr 13, 2022 at 12:20:54PM +0800, Liu Yiding wrote:
>> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default
>>
>> Signed-off-by: Liu Yiding 
> Looks good. Our default used to be --thread-pool-size=64. But we changed
> it to using no thread pool because on lower end of workloads it performed
> better. When multiple threads are doing parallel I/O then, thread pool
> helps. So people who want to do lots of parallel I/O should manually
> enable thread pool.
>
> Acked-by: Vivek Goyal 
>
> Vivek
>> ---
>>   docs/tools/virtiofsd.rst | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
>> index 0c0560203c..33fed08c6f 100644
>> --- a/docs/tools/virtiofsd.rst
>> +++ b/docs/tools/virtiofsd.rst
>> @@ -127,7 +127,7 @@ Options
>>   .. option:: --thread-pool-size=NUM
>>   
>> Restrict the number of worker threads per request queue to NUM.  The 
>> default
>> -  is 64.
>> +  is 0.
>>   
>>   .. option:: --cache=none|auto|always
>>   
>> -- 
>> 2.31.1
>>
>>
>>
>>
-- 
Best Regards.
Yiding Liu