linux-um archives
 help / color / mirror / Atom feed
From: Benjamin Berg <benjamin@sipsolutions.net>
To: Tiwei Bie <tiwei.btw@antgroup.com>,
	Johannes Berg	 <johannes@sipsolutions.net>,
	richard@nod.at, anton.ivanov@cambridgegreys.com
Cc: linux-um@lists.infradead.org
Subject: Re: [PATCH v2 1/4] um: Add pthread-based helper support
Date: Tue, 25 Mar 2025 17:31:02 +0100	[thread overview]
Message-ID: <e09f89242902f4a169196f16836e53665198f616.camel@sipsolutions.net> (raw)
In-Reply-To: <870c3af1-10e3-4629-93de-cb92a83de00d@antgroup.com>

On Tue, 2025-03-18 at 22:55 +0800, Tiwei Bie wrote:
> On 2025/3/18 21:16, Johannes Berg wrote:
> > On Tue, 2025-03-18 at 14:06 +0100, Johannes Berg wrote:
> > > On Thu, 2025-03-06 at 23:07 +0800, Tiwei Bie wrote:
> > > > Introduce a new set of utility functions that can be used to create
> > > > pthread-based helpers. Helper threads created in this way will ensure
> > > > thread safety for errno while sharing the same memory space.
> > > 
> > > Using pthreads seemed odd, but Benjamin argues that it's the only way to
> > > get libc to really sort it all out, unless we never use libc syscall
> > > functions, which is probably kind of unreasonable? Or maybe we could?
> > 
> > It's a long list of symbols that are needed:
> > https://p.sipsolutions.net/2f0c8e0de1e69147.txt
> 
> Thanks for the list! That's indeed a long one.

So, if we dropped libc, then I think that would also imply dropping the
abstraction to support hosts other than Linux. And then the hard split
between user/kernel code might not be needed anymore as one would
ideally not rely on system headers at all.

I can imagine that parts of the code base would really benefit (e.g.
include handling). While other parts would obviously become more
complicated (e.g. parsing /proc/cpuinfo, mcontext handling).

It seems to me that the cleanup potential is likely big enough to make
it worthwhile.

Benjamin


  reply	other threads:[~2025-03-25 16:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 15:07 [PATCH v2 0/4] um: Make errno multi-thread safe Tiwei Bie
2025-03-06 15:07 ` [PATCH v2 1/4] um: Add pthread-based helper support Tiwei Bie
2025-03-18 13:06   ` Johannes Berg
2025-03-18 13:16     ` Johannes Berg
2025-03-18 14:55       ` Tiwei Bie
2025-03-25 16:31         ` Benjamin Berg [this message]
2025-03-26  6:30           ` Tiwei Bie
2025-03-18 15:00     ` Tiwei Bie
2025-03-19  9:11   ` Johannes Berg
2025-03-19 12:07     ` Tiwei Bie
2025-03-06 15:07 ` [PATCH v2 2/4] um: ubd: Switch to the pthread-based helper Tiwei Bie
2025-03-06 15:07 ` [PATCH v2 3/4] um: Switch to the pthread-based helper in sigio workaround Tiwei Bie
2025-03-06 15:07 ` [PATCH v2 4/4] um: Prohibit the VM_CLONE flag in run_helper_thread() Tiwei Bie

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=e09f89242902f4a169196f16836e53665198f616.camel@sipsolutions.net \
    --to=benjamin@sipsolutions.net \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=tiwei.btw@antgroup.com \
    /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