Re: [PATCH 3/3] kthread: Stop abusing TASK_UNINTERRUPTIBLE (INCOMPLETE)

From: Peter Zijlstra
Date: Tue Jun 28 2022 - 03:59:12 EST


On Tue, Jun 28, 2022 at 12:32:33AM +0000, Wedson Almeida Filho wrote:
> On Tue, Jun 28, 2022 at 12:06:29AM +0200, Peter Zijlstra wrote:
> > On Mon, Jun 27, 2022 at 06:04:12PM +0000, Wedson Almeida Filho wrote:
> >
> > > let new_thread = task::new_paused(|| pr_info!("Hello world\n"))?;
> >
> > I'm still having a really hard time with this Rust stuff, the above
> > looks like a syntax error and random characters to me :/
>
> Peter, I meant to ask in my previous email: setting aside the syntax for
> a moment, do you have an opinion on the sort of things that Rust allows
> us to enforce at compile time (as exemplified in the new_paused()
> fragment)?

So I used to do quite a lot of C++ in a previous life; I think I'm more
or less familiar with a lot of the things Rust offers, except it is a
lot stricter. C++ allows you to do the right thing, but also allows you
to take your own foot off (a bit like C, except you can make an even
bigger mess of things), where Rust tries really hard to protect the
foot.

The one thing I dread is compile times, C++ is bad, but given Rust has
to do even more compile time enforcement it'll suck worse. And I'm
already not using clang because it's so much worse than gcc.

I've just not had *any* time to actually look at Rust in any detail :/

But given I'm the kind of idiot that does tree-wide cleanups just
because it's the right thing, I'm bound to run into it sooner rather
than later, and then I'll curse my way through having to learn it just
to get crap done I expect ...

Anyway; from what I understand Rust is a fair way away from core code.