lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <671a514f-8597-7693-1323-929e39c56dda@linux.alibaba.com>
Date:   Fri, 18 Aug 2023 15:48:08 +0800
From:   Gao Xiang <hsiangkao@...ux.alibaba.com>
To:     Yue Hu <zbestahu@...il.com>
Cc:     linux-erofs@...ts.ozlabs.org, LKML <linux-kernel@...r.kernel.org>,
        huyue2@...lpad.com
Subject: Re: [PATCH 6/8] erofs: get rid of fe->backmost for cache
 decompression



On 2023/8/18 13:51, Yue Hu wrote:
> On Thu, 17 Aug 2023 16:28:11 +0800
> Gao Xiang <hsiangkao@...ux.alibaba.com> wrote:
> 
>> EROFS_MAP_FULL_MAPPED is more accurate to decide if caching the last
>> incomplete pcluster for later read or not.
>>
>> Signed-off-by: Gao Xiang <hsiangkao@...ux.alibaba.com>
>> ---
>>   fs/erofs/zdata.c | 7 ++-----
>>   1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
>> index 4009283944ca..c28945532a02 100644
>> --- a/fs/erofs/zdata.c
>> +++ b/fs/erofs/zdata.c
>> @@ -528,8 +528,6 @@ struct z_erofs_decompress_frontend {
>>   	z_erofs_next_pcluster_t owned_head;
>>   	enum z_erofs_pclustermode mode;
>>   
>> -	/* used for applying cache strategy on the fly */
>> -	bool backmost;
>>   	erofs_off_t headoffset;
>>   
>>   	/* a pointer used to pick up inplace I/O pages */
>> @@ -538,7 +536,7 @@ struct z_erofs_decompress_frontend {
>>   
>>   #define DECOMPRESS_FRONTEND_INIT(__i) { \
>>   	.inode = __i, .owned_head = Z_EROFS_PCLUSTER_TAIL, \
>> -	.mode = Z_EROFS_PCLUSTER_FOLLOWED, .backmost = true }
>> +	.mode = Z_EROFS_PCLUSTER_FOLLOWED }
>>   
>>   static bool z_erofs_should_alloc_cache(struct z_erofs_decompress_frontend *fe)
>>   {
>> @@ -547,7 +545,7 @@ static bool z_erofs_should_alloc_cache(struct z_erofs_decompress_frontend *fe)
>>   	if (cachestrategy <= EROFS_ZIP_CACHE_DISABLED)
>>   		return false;
>>   
>> -	if (fe->backmost)
>> +	if (!(fe->map.m_flags & EROFS_MAP_FULL_MAPPED))
> 
> So, i understand (map.m_flags & EROFS_MAP_FULL_MAPPED) should be false if allocate cache is needed
> (fe->backmost is true)?

fe->backmost is inaccurate compared with !EROFS_MAP_FULL_MAPPED,
if !EROFS_MAP_FULL_MAPPED, it should be cached instead.

Thanks,
Gao Xiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ