Linux-EROFS Archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Yifan Zhao <zhaoyifan@sjtu.edu.cn>, Noboru Asai <asai@sijam.com>
Cc: linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH] erofs-utils: change temporal buffer to non static
Date: Mon, 8 Apr 2024 19:24:36 +0800	[thread overview]
Message-ID: <8343c31b-d096-4b6b-808e-7e5c5548c411@linux.alibaba.com> (raw)
In-Reply-To: <c12daa04-c41d-4b6b-acce-26bd885f142c@sjtu.edu.cn>

Hi Yifan,

On 2024/4/8 18:34, Yifan Zhao wrote:
> Hi Noboru,
> 
> 
> AFAIK, this `tryrecompress_trailing` is only used when `may_inline` is true, indicating that
> 
> this segment is the last one in the file. In the current inner-file implementation, it means
> 
> that only one worker will use the `tmp` buffer at a given time.
> 
> 
> In fact, the `static` modifier is removed in the first version of the patchset, but the change
> 
> is reversed during the review. I think Xiang may share his opinion about this.


Yes, I think it will impact inter-file implementation, but that doesn't matter since we'll
finally enable this.  So I will apply this first :)

Thanks,
Gao Xiang

> 
> 
> Thanks,
> 
> Yifan Zhao
> 
> On 4/8/24 5:16 PM, Noboru Asai wrote:
>> In multi-threaded mode, each thread must use a different buffer in tryrecompress_trailing
>> function, so change this buffer to non static.
>>
>> Signed-off-by: Noboru Asai <asai@sijam.com>
>> ---
>>   lib/compress.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/compress.c b/lib/compress.c
>> index 641fde6..7415fda 100644
>> --- a/lib/compress.c
>> +++ b/lib/compress.c
>> @@ -447,7 +447,7 @@ static void tryrecompress_trailing(struct z_erofs_compress_sctx *ctx,
>>                      void *out, unsigned int *compressedsize)
>>   {
>>       struct erofs_sb_info *sbi = ctx->ictx->inode->sbi;
>> -    static char tmp[Z_EROFS_PCLUSTER_MAX_SIZE];
>> +    char tmp[Z_EROFS_PCLUSTER_MAX_SIZE];
>>       unsigned int count;
>>       int ret = *compressedsize;

  reply	other threads:[~2024-04-08 11:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  9:16 [PATCH] erofs-utils: change temporal buffer to non static Noboru Asai
2024-04-08 10:34 ` Yifan Zhao
2024-04-08 11:24   ` Gao Xiang [this message]
2024-04-08 11:23 ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8343c31b-d096-4b6b-808e-7e5c5548c411@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=asai@sijam.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=zhaoyifan@sjtu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).