[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201123230510.GI132317@mit.edu>
Date: Mon, 23 Nov 2020 18:05:10 -0500
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Saranya Muruganandam <saranyamohan@...gle.com>
Cc: linux-ext4@...r.kernel.org, adilger.kernel@...ger.ca,
Li Xi <lixi@....com>, Wang Shilong <wshilong@....com>
Subject: Re: [RFC PATCH v3 09/61] e2fsck: create logs for mult-threads
On Wed, Nov 18, 2020 at 07:38:55AM -0800, Saranya Muruganandam wrote:
> From: Li Xi <lixi@....com>
>
> When multi-threads are used, different logs should be created
> for different threads. Each thread has log files with suffix
> of ".$THREAD_INDEX".
>
> And this patch adds f_multithread_logfile test case.
I'm not convinced this is the best approach; why not add a
(thread-aware) log abstraction? That way there can be a single
logfile, which is going to be much more user/admin/SRE-friendly.
We also need to add some kind of mutex if we are multi-threading in
e2fsck/message.c, since POSIX guarantees that the dio functions are
thread-safe --- but only on a per function basis. So if we don't want
the output to the terminal to potentially be scrambled, we need to
take a mutex in print_e2fsck_message() if we are in multi-threading
mode, so that only one thread is printing to the terminal at a time.
(And certainly if we are going to be asking a question of the user, we
*definitely* need to be taking some kind of mutex first!)
- Ted
Powered by blists - more mailing lists