Skip to contentSkip to conversation

Introduce down_killable()

DISCUSSION Andrew Morton 2 participants 2 messages Apr 18, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

kernel/semaphore.c line 38

Quoted 8 lines · On Fri, 18 Apr 2008 17:05:06 GMT Linux Kernel Mailing List…
kernel/semaphore.c +1 -0
@@ -34,6 +34,7 @@
 
 static noinline void __down(struct semaphore *sem);
 static noinline int __down_interruptible(struct semaphore *sem);
+static noinline int __down_killable(struct semaphore *sem);
 static noinline void __up(struct semaphore *sem);

What is the reason for all the noinlines in this file?

Something to do with getting proper wchan output? I guess it doesn't hurt from a documentation POV, but did you find that it was actually necessary?

IOW: is gcc now capable of secretly inlining functions which are defined further ahead in the compilation unit?

(did you actually "test" the wchan stuff, btw?)

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 4 lines · On Fri, 18 Apr 2008 17:05:06 GMT Linux Kernel Mailing List…
kernel/semaphore.c +0 -0
@@ -34,6 +34,7 @@
 
Quoted 6 lines

kernel/semaphore.c line 38

Quoted 4 lines
kernel/semaphore.c +1 -0
 static noinline void __down(struct semaphore *sem);
 static noinline int __down_interruptible(struct semaphore *sem);
+static noinline int __down_killable(struct semaphore *sem);
 static noinline void __up(struct semaphore *sem);

What is the reason for all the noinlines in this file?

Copied from kernel/mutex.c ;-)

The reason is to make sure that __down_interruptible (et al) are out-of-line from down_interruptible, and that __down_common is inlined into __down_interruptible().

Quoted 5 lines

Something to do with getting proper wchan output? I guess it doesn't hurt from a documentation POV, but did you find that it was actually necessary?

IOW: is gcc now capable of secretly inlining functions which are defined further ahead in the compilation unit?

With -funit-at-a-time, I believe it is capable of that.

Quoted 1 line

(did you actually "test" the wchan stuff, btw?)

I tested that wchan still produces the right output, yes.

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."