<div dir="ltr"><div>thank you for your reply.</div>it sounds good to me.<div><br></div><div>how about extract `wq_trace_init` from `init_work_queue` (lib/work.c) and </div><div>call it in the main() function just before the initialization of journal file.</div><div>we can initialize work queue trace related variable before the initialization of </div><div>work queue. In this manner, we don't need a new function.</div><div><br></div><div><br></div><div>Thanks</div><div>Jinzhi Chen</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 30, 2014 at 9:42 AM, Hitoshi Mitake <span dir="ltr"><<a href="mailto:mitake.hitoshi@lab.ntt.co.jp" target="_blank">mitake.hitoshi@lab.ntt.co.jp</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Hi Jinzhi, thanks for your patch.<br>
<br>
At Wed, 29 Oct 2014 13:53:14 +0800,<br>
Jinzhi Chen wrote:<br>
><br>
> [1 <multipart/alternative (7bit)>]<br>
> [1.1 <text/plain; UTF-8 (7bit)>]<br>
<span class="">> journal thread uses `tid_max` which is not initialized until<br>
> later initial progress. The default value 0 cause journal<br>
> thread loop in the function `trace_set_tid_map` , so set<br>
> default value to 1.<br>
><br>
> Signed-off-by: jinzhichen <<a href="mailto:nxtjinzhi@gmail.com">nxtjinzhi@gmail.com</a>><br>
<br>
</span>Could you write your name "Jinzhi Chen" instead of jinzhichen in<br>
Signed-off-by: line?<br>
<span class=""><br>
> ---<br>
> lib/work.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/lib/work.c b/lib/work.c<br>
> index 7e2cd79..7b20685 100644<br>
> --- a/lib/work.c<br>
> +++ b/lib/work.c<br>
> @@ -75,7 +75,7 @@ static void *worker_routine(void *arg);<br>
><br>
> #define TID_MAX_DEFAULT 0x8000 /* default maximum tid for most systems */<br>
><br>
> -static size_t tid_max;<br>
> +static size_t tid_max = 1;<br>
<br>
</span>How about the below way? Extracting the code<br>
<br>
tid_max = TID_MAX_DEFAULT;<br>
tid_map = alloc_bitmap(NULL, 0, tid_max);<br>
<br>
from wq_trace_init(), prepare a new function,<br>
e.g. early_trace_init(), which does the above initialization, and let<br>
main() call the function in its early part. Practically your patch can<br>
solve the problem but the above way will not produce a combination of<br>
initialized tid_max and uninitialized tid_map. How do you think?<br>
<br>
Thanks,<br>
Hitoshi<br>
<span class=""><br>
> static unsigned long *tid_map;<br>
> static struct sd_mutex tid_map_lock = SD_MUTEX_INITIALIZER;<br>
><br>
> --<br>
> 1.7.9.5<br>
</span>> [1.2 <text/html; UTF-8 (quoted-printable)>]<br>
><br>
> [2 <text/plain; us-ascii (7bit)>]<br>
<span class=""><font color="#888888">> --<br>
> sheepdog mailing list<br>
> <a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
> <a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</font></span></blockquote></div><br></div></div></div>