Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2020 15:03:49 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r362829 - head/sys/compat/linuxkpi/common/src
Message-ID:  <20200701120349.GK32126@kib.kiev.ua>
In-Reply-To: <6563154f-cd07-8468-e4fa-2d23aba4f908@selasky.org>
References:  <202007010823.0618Nvcu028770@repo.freebsd.org> <20200701092123.GI32126@kib.kiev.ua> <6478a8b2-9bfc-a671-4087-c2de92fea239@selasky.org> <20200701103028.GJ32126@kib.kiev.ua> <6563154f-cd07-8468-e4fa-2d23aba4f908@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 01, 2020 at 12:56:12PM +0200, Hans Petter Selasky wrote:
> On 2020-07-01 12:30, Konstantin Belousov wrote:
> > I see no point in repeating the same pfind/tdfind calls, better to convert
> > them to pget(), and have this code in one intended place.
> 
> I wonder if we can convert all cases in linux_current.c to use pget(). Could
> you have a look too?

Other uses in linux_current.c are not suitable for pget().  In case
linux_pid_task()/linux_get_pid_task() were passed a tid instead of pid,
current code returns lkpi_task for the specified thread.  In other words,
if using pget(), we would need to find the thread after the call, which
makes no sense.

On the other hand, there are at least two aspects that can be improved.
First, the functions are too similar to require separating body.  Second,
distinction between pid and tid is static and if we are passed pid, it
makes no sense to call tdfind() on it.

https://reviews.freebsd.org/D25534



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200701120349.GK32126>