Re: [PATCH 1/2] utrace core

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexey Dobriyan
Date: Wednesday, September 3, 2008 - 10:01 am

On Wed, Sep 03, 2008 at 05:11:27AM -0700, Roland McGrath wrote:

That's correct but shouldn't be taken to extreme as usual.


By how many?


Engine part is irrelevant for deciding "struct utrace utrace;" vs
"struct utrace *utrace;"


Let's actually measure something.

1) clean kernel (my usual config, x86_64, NR_CPUS=2, PREEMPT=y, SLUB_DEBUG=y)
2) struct utrace *utrace;
3) struct utrace utrace; (without rcu_head, without check_dead)

			taken from symlink
	cache		/object_size, bytes
----------------------------------------
1)	task_struct	1392/1384

2)	task_struct	1408/1400
	utrace		72/72

3)	task_struct	1456/1456


I don't know why "object_size" differs from to where symlink points to
but it's irrelevant.

So, your approach gives +16(+72) bytes, mine gives +72 bytes.

So all this complexity is for ~56 bytes in untraced case. In traced
case, more memory will be used.

For 32-bit difference should be smaller because pointers are smaller.


I mean sticking to simple locking rules if you agree to "struct utrace utrace;":
1) utrace_flags go into struct utrace
2) utrace.lock guards _everything_ under it, no exceptions.

If I understand correctly ->utrace_flags are under utrace->lock, BUT
struct utrace is reattachable itself. Of course you protect against it,
but this doesn't help in convincing someone that there are no problems.

Again, this is just general observation and an example. Checking for
bugs will be much, much simpler.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] utrace, Roland McGrath, (Tue Aug 26, 3:01 pm)
[PATCH 1/2] utrace core, Roland McGrath, (Tue Aug 26, 3:01 pm)
[PATCH 2/2] utrace: ptrace cooperation, Roland McGrath, (Tue Aug 26, 3:02 pm)
Re: [PATCH 0/2] utrace, Alexey Dobriyan, (Tue Aug 26, 3:34 pm)
Re: [PATCH 0/2] utrace, Christoph Hellwig, (Tue Aug 26, 3:39 pm)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Tue Aug 26, 3:55 pm)
Re: [PATCH 0/2] utrace, Frank Ch. Eigler, (Tue Aug 26, 5:17 pm)
Re: [PATCH 0/2] utrace, Peter Zijlstra, (Tue Aug 26, 7:03 pm)
Re: [PATCH 0/2] utrace, Christoph Hellwig, (Wed Aug 27, 6:54 am)
Re: [PATCH 0/2] utrace, Alexey Dobriyan, (Wed Aug 27, 8:34 am)
Re: [PATCH 0/2] utrace, Ananth N Mavinakayan ..., (Wed Aug 27, 9:40 am)
Re: [PATCH 0/2] utrace, Alexey Dobriyan, (Wed Aug 27, 11:50 am)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Wed Aug 27, 1:04 pm)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Wed Aug 27, 2:32 pm)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Wed Aug 27, 2:46 pm)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Wed Aug 27, 3:00 pm)
Re: [PATCH 0/2] utrace, Frank Ch. Eigler, (Fri Aug 29, 12:04 pm)
Re: [PATCH 2/2] utrace: ptrace cooperation, Christoph Hellwig, (Sat Aug 30, 6:38 am)
Re: [PATCH 0/2] utrace, Christoph Hellwig, (Sat Aug 30, 6:40 am)
Re: [PATCH 0/2] utrace, Christoph Hellwig, (Sat Aug 30, 6:43 am)
Re: [PATCH 1/2] utrace core, Christoph Hellwig, (Sat Aug 30, 6:45 am)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Sat Aug 30, 8:05 am)
Re: [PATCH 0/2] utrace, Roland McGrath, (Wed Sep 3, 5:09 am)
Re: [PATCH 2/2] utrace: ptrace cooperation, Roland McGrath, (Wed Sep 3, 5:10 am)
Re: [PATCH 1/2] utrace core, Roland McGrath, (Wed Sep 3, 5:11 am)
Re: [PATCH 1/2] utrace core, Roland McGrath, (Wed Sep 3, 5:11 am)
Re: [PATCH 1/2] utrace core, Petr Tesarik, (Wed Sep 3, 5:58 am)
Re: [PATCH 1/2] utrace core, Alexey Dobriyan, (Wed Sep 3, 10:01 am)
Re: [PATCH 1/2] utrace core, Roland McGrath, (Wed Sep 3, 11:08 am)
Re: [PATCH 0/2] utrace, Christoph Hellwig, (Wed Sep 3, 11:37 am)
Re: [PATCH 2/2] utrace: ptrace cooperation, Christoph Hellwig, (Wed Sep 3, 11:41 am)
Re: [PATCH 1/2] utrace core, Christoph Hellwig, (Wed Sep 3, 11:44 am)
Re: [PATCH 1/2] utrace core, Christoph Hellwig, (Wed Sep 3, 11:46 am)
Re: [PATCH 1/2] utrace core, Petr Tesarik, (Thu Sep 4, 2:03 am)
Re: [PATCH 0/2] utrace, Peter Zijlstra, (Mon Oct 6, 1:47 pm)