public inbox for linux-erofs@ozlabs.org
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: lib: name worker threads erofs_compress
@ 2026-03-16 15:13 Nithurshen
  2026-03-16 16:49 ` Gao Xiang
  0 siblings, 1 reply; 11+ messages in thread
From: Nithurshen @ 2026-03-16 15:13 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen

Set a specific thread name for the multi-threaded workqueue workers
to make debugging, profiling, and process monitoring significantly
easier.

Previously, worker threads inherited the name of the parent process
(e.g., mkfs.erofs), making it difficult to distinguish them from the
main thread in tools like \`top\`, \`htop\`, or \`ps\`.

This utilizes \`prctl(PR_SET_NAME)\` on Linux and \`pthread_setname_np\`
on macOS to explicitly label these threads as \"erofs_compress\" upon
initialization.

Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
 lib/workqueue.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/workqueue.c b/lib/workqueue.c
index 18ee0f9..860e403 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -2,6 +2,9 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include "erofs/workqueue.h"
+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
 
 static void *worker_thread(void *arg)
 {
@@ -9,6 +12,12 @@ static void *worker_thread(void *arg)
 	struct erofs_work *work;
 	void *tlsp = NULL;
 
+#if defined(__linux__)
+	prctl(PR_SET_NAME, "erofs_compress");
+#elif defined(__APPLE__)
+	pthread_setname_np("erofs_compress");
+#endif
+
 	if (wq->on_start)
 		tlsp = (wq->on_start)(wq, NULL);
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 15:13 [PATCH] erofs-utils: lib: name worker threads erofs_compress Nithurshen
@ 2026-03-16 16:49 ` Gao Xiang
  2026-03-16 16:54   ` [PATCH v2] " Nithurshen
                     ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Gao Xiang @ 2026-03-16 16:49 UTC (permalink / raw)
  To: Nithurshen, linux-erofs; +Cc: xiang



On 2026/3/16 23:13, Nithurshen wrote:
> Set a specific thread name for the multi-threaded workqueue workers
> to make debugging, profiling, and process monitoring significantly
> easier.
> 
> Previously, worker threads inherited the name of the parent process
> (e.g., mkfs.erofs), making it difficult to distinguish them from the
> main thread in tools like \`top\`, \`htop\`, or \`ps\`.

Please just use `top`, `htop`, or `ps` here.

> 
> This utilizes \`prctl(PR_SET_NAME)\` on Linux and \`pthread_setname_np\`
> on macOS to explicitly label these threads as \"erofs_compress\" upon
> initialization.

Why not just calling erofs_compressor, since those worker are really
compressor.

> 
> Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
> ---
>   lib/workqueue.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/lib/workqueue.c b/lib/workqueue.c
> index 18ee0f9..860e403 100644
> --- a/lib/workqueue.c
> +++ b/lib/workqueue.c
> @@ -2,6 +2,9 @@
>   #include <pthread.h>
>   #include <stdlib.h>
>   #include "erofs/workqueue.h"
> +#if defined(__linux__)
> +#include <sys/prctl.h>
> +#endif
>   
>   static void *worker_thread(void *arg)
>   {
> @@ -9,6 +12,12 @@ static void *worker_thread(void *arg)
>   	struct erofs_work *work;
>   	void *tlsp = NULL;
>   
> +#if defined(__linux__)
> +	prctl(PR_SET_NAME, "erofs_compress");
> +#elif defined(__APPLE__)
> +	pthread_setname_np("erofs_compress");
> +#endif

I don't think they should be added here, you could
add in .on_start() of lib/compress.c instead.

Thanks,
Gao Xiang

> +
>   	if (wq->on_start)
>   		tlsp = (wq->on_start)(wq, NULL);
>   



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 16:49 ` Gao Xiang
@ 2026-03-16 16:54   ` Nithurshen
  2026-03-16 17:00     ` Gao Xiang
  2026-03-16 17:02   ` [PATCH v3] " Nithurshen
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Nithurshen @ 2026-03-16 16:54 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen

Set a specific thread name for the multi-threaded workqueue workers
to make debugging, profiling, and process monitoring significantly
easier.

Previously, worker threads inherited the name of the parent process
(e.g., mkfs.erofs), making it difficult to distinguish them from the
main thread in tools like `top`, `htop`, or `ps`.

This utilizes `prctl(PR_SET_NAME)` on Linux and `pthread_setname_np`
on macOS to explicitly label these threads as "erofs_compress" upon
initialization.

Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
 lib/workqueue.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/workqueue.c b/lib/workqueue.c
index 18ee0f9..860e403 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -2,6 +2,9 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include "erofs/workqueue.h"
+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
 
 static void *worker_thread(void *arg)
 {
@@ -9,6 +12,12 @@ static void *worker_thread(void *arg)
 	struct erofs_work *work;
 	void *tlsp = NULL;
 
+#if defined(__linux__)
+	prctl(PR_SET_NAME, "erofs_compress");
+#elif defined(__APPLE__)
+	pthread_setname_np("erofs_compress");
+#endif
+
 	if (wq->on_start)
 		tlsp = (wq->on_start)(wq, NULL);
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 16:54   ` [PATCH v2] " Nithurshen
@ 2026-03-16 17:00     ` Gao Xiang
  0 siblings, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2026-03-16 17:00 UTC (permalink / raw)
  To: Nithurshen, linux-erofs; +Cc: xiang



On 2026/3/17 00:54, Nithurshen wrote:

..

>   static void *worker_thread(void *arg)
>   {
> @@ -9,6 +12,12 @@ static void *worker_thread(void *arg)
>   	struct erofs_work *work;
>   	void *tlsp = NULL;
>   
> +#if defined(__linux__)
> +	prctl(PR_SET_NAME, "erofs_compress");
> +#elif defined(__APPLE__)
> +	pthread_setname_np("erofs_compress");
> +#endif

I'm not happy with this part, please read the v1 reply.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 16:49 ` Gao Xiang
  2026-03-16 16:54   ` [PATCH v2] " Nithurshen
@ 2026-03-16 17:02   ` Nithurshen
  2026-03-16 17:05     ` Gao Xiang
  2026-03-16 17:11   ` [PATCH] " Nithurshen Karthikeyan
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Nithurshen @ 2026-03-16 17:02 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen

Set a specific thread name for the multi-threaded workqueue workers
to make debugging, profiling, and process monitoring significantly
easier.

Previously, worker threads inherited the name of the parent process
(e.g., mkfs.erofs), making it difficult to distinguish them from the
main thread in tools like top, htop, or ps.

This utilizes prctl(PR_SET_NAME) on Linux and pthread_setname_np
on macOS to explicitly label these threads as "erofs_compressor" upon
initialization in the workqueue's .on_start() callback.

Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
 lib/compress.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/compress.c b/lib/compress.c
index 4a0d890..66b3b8b 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -26,6 +26,9 @@
 #include "liberofs_compress.h"
 #include "liberofs_fragments.h"
 #include "liberofs_metabox.h"
+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
 
 #define Z_EROFS_DESTBUF_SZ	(Z_EROFS_PCLUSTER_MAX_SIZE + EROFS_MAX_BLOCK_SIZE * 2)
 
@@ -1427,6 +1430,12 @@ void *z_erofs_mt_wq_tls_alloc(struct erofs_workqueue *wq, void *ptr)
 {
 	struct erofs_compress_wq_tls *tls;
 
+#if defined(__linux__)
+	prctl(PR_SET_NAME, "erofs_compress");
+#elif defined(__APPLE__)
+	pthread_setname_np("erofs_compress");
+#endif
+
 	tls = calloc(1, sizeof(*tls));
 	if (!tls)
 		return NULL;
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 17:02   ` [PATCH v3] " Nithurshen
@ 2026-03-16 17:05     ` Gao Xiang
  0 siblings, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2026-03-16 17:05 UTC (permalink / raw)
  To: Nithurshen, linux-erofs; +Cc: xiang



On 2026/3/17 01:02, Nithurshen wrote:

..


> @@ -1427,6 +1430,12 @@ void *z_erofs_mt_wq_tls_alloc(struct erofs_workqueue *wq, void *ptr)
>   {
>   	struct erofs_compress_wq_tls *tls;
>   
> +#if defined(__linux__)
> +	prctl(PR_SET_NAME, "erofs_compress");
> +#elif defined(__APPLE__)
> +	pthread_setname_np("erofs_compress");
> +#endif

Why not call them as `erofs_compressor`?

and could we wrap it up as a new function like:

erofs_set_thread_name() somewhere instead so that
users can use it easier instead?

Thanks,
Gao Xiang

> +
>   	tls = calloc(1, sizeof(*tls));
>   	if (!tls)
>   		return NULL;



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 16:49 ` Gao Xiang
  2026-03-16 16:54   ` [PATCH v2] " Nithurshen
  2026-03-16 17:02   ` [PATCH v3] " Nithurshen
@ 2026-03-16 17:11   ` Nithurshen Karthikeyan
  2026-03-16 17:15     ` Gao Xiang
  2026-03-16 17:25   ` [PATCH v4] erofs-utils: lib: name worker threads erofscompressor Nithurshen
  2026-03-16 18:01   ` [PATCH v5] " Nithurshen
  4 siblings, 1 reply; 11+ messages in thread
From: Nithurshen Karthikeyan @ 2026-03-16 17:11 UTC (permalink / raw)
  To: Gao Xiang; +Cc: linux-erofs, xiang

Hi Xiang,

Sorry for the confusion. I sent the v2 patch before reading your
v1 reply, as I noticed the quotes formatting was off in my first
submission and wanted to fix it.

On Mon, Mar 16, 2026 at 10:19 PM Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
>
> On 2026/3/16 23:13, Nithurshen wrote:
> > Set a specific thread name for the multi-threaded workqueue workers
> > to make debugging, profiling, and process monitoring significantly
> > easier.
> >
> > Previously, worker threads inherited the name of the parent process
> > (e.g., mkfs.erofs), making it difficult to distinguish them from the
> > main thread in tools like \`top\`, \`htop\`, or \`ps\`.
>
> Please just use `top`, `htop`, or `ps` here.

Yes, I have taken care of this in the updated commit message.

> > This utilizes \`prctl(PR_SET_NAME)\` on Linux and \`pthread_setname_np\`
> > on macOS to explicitly label these threads as \"erofs_compress\" upon
> > initialization.
>
> Why not just calling erofs_compressor, since those worker are really
> compressor.

I initially tested using "erofs_compressor", but the OS thread naming
API (`prctl` with `PR_SET_NAME`) has a strict 16-byte limit,
which includes the null terminator.

Because "erofs_compressor" is exactly 16 characters long, the null
byte pushes it to 17 bytes. As a result, the kernel truncates it, and
it actually shows up as "erofs_compresso" in `ps` and `top`.

To keep the output looking clean and intentional, I chose to use
"erofs_compress" (14 chars) instead. Please let me know if you are
okay with this, or if you'd prefer a different abbreviation.

> > +#if defined(__linux__)
> > +     prctl(PR_SET_NAME, "erofs_compress");
> > +#elif defined(__APPLE__)
> > +     pthread_setname_np("erofs_compress");
> > +#endif
>
> I don't think they should be added here, you could
> add in .on_start() of lib/compress.c instead.

Yes, it has been moved to lib/compress.c

Thanks,
Nithurshen


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] erofs-utils: lib: name worker threads erofs_compress
  2026-03-16 17:11   ` [PATCH] " Nithurshen Karthikeyan
@ 2026-03-16 17:15     ` Gao Xiang
  0 siblings, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2026-03-16 17:15 UTC (permalink / raw)
  To: Nithurshen Karthikeyan; +Cc: linux-erofs, xiang

Hi Nithurshen,

On 2026/3/17 01:11, Nithurshen Karthikeyan wrote:
> Hi Xiang,
> 

...

>>
>> Why not just calling erofs_compressor, since those worker are really
>> compressor.
> 
> I initially tested using "erofs_compressor", but the OS thread naming
> API (`prctl` with `PR_SET_NAME`) has a strict 16-byte limit,
> which includes the null terminator.
> 
> Because "erofs_compressor" is exactly 16 characters long, the null
> byte pushes it to 17 bytes. As a result, the kernel truncates it, and
> it actually shows up as "erofs_compresso" in `ps` and `top`.
> 
> To keep the output looking clean and intentional, I chose to use
> "erofs_compress" (14 chars) instead. Please let me know if you are
> okay with this, or if you'd prefer a different abbreviation.

Ok, or just call it as `erofscompressor`?
`erofs_compress` is really awkward to me.

Thanks,
Gao Xiang


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v4] erofs-utils: lib: name worker threads erofscompressor
  2026-03-16 16:49 ` Gao Xiang
                     ` (2 preceding siblings ...)
  2026-03-16 17:11   ` [PATCH] " Nithurshen Karthikeyan
@ 2026-03-16 17:25   ` Nithurshen
  2026-03-16 17:58     ` Gao Xiang
  2026-03-16 18:01   ` [PATCH v5] " Nithurshen
  4 siblings, 1 reply; 11+ messages in thread
From: Nithurshen @ 2026-03-16 17:25 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen

Set a specific thread name for the multi-threaded workqueue workers
to make debugging, profiling, and process monitoring significantly
easier.

Previously, worker threads inherited the name of the parent process
(e.g., mkfs.erofs), making it difficult to distinguish them from the
main thread in tools like top, htop, or ps.

This introduces a new OS-independent wrapper, erofs_set_thread_name(),
which utilizes prctl(PR_SET_NAME) on Linux and pthread_setname_np on
macOS. This helper is now called during the workqueue's .on_start()
callback in compress.c to explicitly label the worker threads as
"erofscompressor".

Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
 include/erofs/workqueue.h |  2 ++
 lib/compress.c            |  2 ++
 lib/workqueue.c           | 13 +++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/include/erofs/workqueue.h b/include/erofs/workqueue.h
index 36037c3..27d3ba4 100644
--- a/include/erofs/workqueue.h
+++ b/include/erofs/workqueue.h
@@ -31,4 +31,6 @@ int erofs_alloc_workqueue(struct erofs_workqueue *wq, unsigned int nworker,
 			  erofs_wq_func_t on_exit);
 int erofs_queue_work(struct erofs_workqueue *wq, struct erofs_work *work);
 int erofs_destroy_workqueue(struct erofs_workqueue *wq);
+
+void erofs_set_thread_name(const char *name);
 #endif
diff --git a/lib/compress.c b/lib/compress.c
index 4a0d890..65971c9 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -1427,6 +1427,8 @@ void *z_erofs_mt_wq_tls_alloc(struct erofs_workqueue *wq, void *ptr)
 {
 	struct erofs_compress_wq_tls *tls;
 
+	erofs_set_thread_name("erofscompressor");
+
 	tls = calloc(1, sizeof(*tls));
 	if (!tls)
 		return NULL;
diff --git a/lib/workqueue.c b/lib/workqueue.c
index 18ee0f9..c924c1b 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -3,6 +3,19 @@
 #include <stdlib.h>
 #include "erofs/workqueue.h"
 
+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
+
+void erofs_set_thread_name(const char *name)
+{
+	#if defined(__linux__)
+		prctl(PR_SET_NAME, name);
+	#elif defined(__APPLE__)
+		pthread_setname_np(name);
+	#endif
+}
+
 static void *worker_thread(void *arg)
 {
 	struct erofs_workqueue *wq = arg;
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v4] erofs-utils: lib: name worker threads erofscompressor
  2026-03-16 17:25   ` [PATCH v4] erofs-utils: lib: name worker threads erofscompressor Nithurshen
@ 2026-03-16 17:58     ` Gao Xiang
  0 siblings, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2026-03-16 17:58 UTC (permalink / raw)
  To: Nithurshen, linux-erofs; +Cc: xiang



On 2026/3/17 01:25, Nithurshen wrote:

..

> diff --git a/lib/workqueue.c b/lib/workqueue.c
> index 18ee0f9..c924c1b 100644
> --- a/lib/workqueue.c
> +++ b/lib/workqueue.c
> @@ -3,6 +3,19 @@
>   #include <stdlib.h>
>   #include "erofs/workqueue.h"
>   
> +#if defined(__linux__)
> +#include <sys/prctl.h>
> +#endif
> +
> +void erofs_set_thread_name(const char *name)
> +{
> +	#if defined(__linux__)

nit: no indentation for all C macros.  Since you'd
like to contribute more, I hope you could read the
kernel code style too.

Thanks,
Gao Xiang

> +		prctl(PR_SET_NAME, name);
> +	#elif defined(__APPLE__)
> +		pthread_setname_np(name);
> +	#endif
> +}
> +
>   static void *worker_thread(void *arg)
>   {
>   	struct erofs_workqueue *wq = arg;



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v5] erofs-utils: lib: name worker threads erofscompressor
  2026-03-16 16:49 ` Gao Xiang
                     ` (3 preceding siblings ...)
  2026-03-16 17:25   ` [PATCH v4] erofs-utils: lib: name worker threads erofscompressor Nithurshen
@ 2026-03-16 18:01   ` Nithurshen
  4 siblings, 0 replies; 11+ messages in thread
From: Nithurshen @ 2026-03-16 18:01 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen

Set a specific thread name for the multi-threaded workqueue workers
to make debugging, profiling, and process monitoring significantly
easier.

Previously, worker threads inherited the name of the parent process
(e.g., mkfs.erofs), making it difficult to distinguish them from the
main thread in tools like top, htop, or ps.

This introduces a new OS-independent wrapper, erofs_set_thread_name(),
which utilizes prctl(PR_SET_NAME) on Linux and pthread_setname_np on
macOS. This helper is now called during the workqueue's .on_start()
callback in compress.c to explicitly label the worker threads as
"erofscompressor".

Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
 include/erofs/workqueue.h |  2 ++
 lib/compress.c            |  2 ++
 lib/workqueue.c           | 13 +++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/include/erofs/workqueue.h b/include/erofs/workqueue.h
index 36037c3..27d3ba4 100644
--- a/include/erofs/workqueue.h
+++ b/include/erofs/workqueue.h
@@ -31,4 +31,6 @@ int erofs_alloc_workqueue(struct erofs_workqueue *wq, unsigned int nworker,
 			  erofs_wq_func_t on_exit);
 int erofs_queue_work(struct erofs_workqueue *wq, struct erofs_work *work);
 int erofs_destroy_workqueue(struct erofs_workqueue *wq);
+
+void erofs_set_thread_name(const char *name);
 #endif
diff --git a/lib/compress.c b/lib/compress.c
index 4a0d890..65971c9 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -1427,6 +1427,8 @@ void *z_erofs_mt_wq_tls_alloc(struct erofs_workqueue *wq, void *ptr)
 {
 	struct erofs_compress_wq_tls *tls;
 
+	erofs_set_thread_name("erofscompressor");
+
 	tls = calloc(1, sizeof(*tls));
 	if (!tls)
 		return NULL;
diff --git a/lib/workqueue.c b/lib/workqueue.c
index 18ee0f9..1811c9c 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -3,6 +3,19 @@
 #include <stdlib.h>
 #include "erofs/workqueue.h"
 
+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
+
+void erofs_set_thread_name(const char *name)
+{
+#if defined(__linux__)
+	prctl(PR_SET_NAME, name);
+#elif defined(__APPLE__)
+	pthread_setname_np(name);
+#endif
+}
+
 static void *worker_thread(void *arg)
 {
 	struct erofs_workqueue *wq = arg;
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-16 18:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 15:13 [PATCH] erofs-utils: lib: name worker threads erofs_compress Nithurshen
2026-03-16 16:49 ` Gao Xiang
2026-03-16 16:54   ` [PATCH v2] " Nithurshen
2026-03-16 17:00     ` Gao Xiang
2026-03-16 17:02   ` [PATCH v3] " Nithurshen
2026-03-16 17:05     ` Gao Xiang
2026-03-16 17:11   ` [PATCH] " Nithurshen Karthikeyan
2026-03-16 17:15     ` Gao Xiang
2026-03-16 17:25   ` [PATCH v4] erofs-utils: lib: name worker threads erofscompressor Nithurshen
2026-03-16 17:58     ` Gao Xiang
2026-03-16 18:01   ` [PATCH v5] " Nithurshen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox