Re: [PATCH 02/10] exit: Add and use make_task_dead.

From: Al Viro
Date: Wed Jan 05 2022 - 18:35:14 EST


On Wed, Jan 05, 2022 at 02:51:05PM -0800, Linus Torvalds wrote:
> On Wed, Jan 5, 2022 at 1:53 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Wed, Jan 05, 2022 at 02:46:10PM -0600, Eric W. Biederman wrote:
> > >
> > > Being in assembly it did not have anything after the name do_exit so it
> > > hid from my regex "[^A-Za-z0-9_]do_exit[^A-Za-z0-9]". Thank you for
> > > finding that.
> >
> > Umm... What's wrong with '\<do_exit\>'?
>
> Christ people, you both make it so complicated.
>
> If you want to search for 'do_exit', just do
>
> git grep -w do_exit
>
> where that '-w' does exactly that "word boundary" thing.

Sure.

> I thought everybody knew about this, because it's such a common thing
> to do - checking my shell history, more than a third of my "git grep"
> uses use '-w', exactly because it's very convenient for identifier
> lookup
>
> But yes, in more complex cases where you have other parts to the
> pattern (ie you're not looking *just* for a single word), by all means
> use '\<' and/or '\>'.

Yep. I wanted to make it clear that you really don't need that kind
of horrors ([^A-Za-z0-9_]); sure, on the ends of regex you just need
-w and that's it, but it's not needed in more convoluted cases either.

BTW, it doesn't have to be "have other parts of pattern" - IME the typical
case when -w is not enough is something like

git grep -n '\<wait_for_completion'