* linux-next: manual merge of the tip tree with the limits tree
@ 2010-04-14 3:59 Stephen Rothwell
2010-04-14 6:41 ` Jiri Slaby
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2010-04-14 3:59 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
Cc: linux-next, linux-kernel, Jiri Slaby
Hi all,
Today's linux-next merge of the tip tree got a conflict in
kernel/posix-cpu-timers.c between commit
0c1b5ce8de67c36bbf67db38240a91f358133bdd ("core: add task_struct to
update_rlimit_cpu") from the limits tree and commit
f55db609042faecd5e518ce372b87f846659b32e ("cpu-timers: Simplify
RLIMIT_CPU handling") from the tip tree.
I did the obvious fixup (see below) but it is probably not completely
correct. Jiri, did I see Linus ask for major revisions of the writable
limits work?
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
diff --cc kernel/posix-cpu-timers.c
index 2807ef8,799f360..0000000
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@@ -11,19 -11,18 +11,18 @@@
#include <trace/events/timer.h>
/*
- * Called after updating RLIMIT_CPU to set timer expiration if necessary.
+ * Called after updating RLIMIT_CPU to run cpu timer and update
+ * tsk->signal->cputime_expires expiration cache if necessary. Needs
+ * siglock protection since other code may update expiration cache as
+ * well.
*/
-void update_rlimit_cpu(unsigned long rlim_new)
+void update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new)
{
cputime_t cputime = secs_to_cputime(rlim_new);
- struct signal_struct *const sig = task->signal;
- if (cputime_eq(sig->it[CPUCLOCK_PROF].expires, cputime_zero) ||
- cputime_gt(sig->it[CPUCLOCK_PROF].expires, cputime)) {
- spin_lock_irq(&task->sighand->siglock);
- set_process_cpu_timer(task, CPUCLOCK_PROF, &cputime, NULL);
- spin_unlock_irq(&task->sighand->siglock);
- }
- spin_lock_irq(¤t->sighand->siglock);
- set_process_cpu_timer(current, CPUCLOCK_PROF, &cputime, NULL);
- spin_unlock_irq(¤t->sighand->siglock);
++ spin_lock_irq(&task->sighand->siglock);
++ set_process_cpu_timer(task, CPUCLOCK_PROF, &cputime, NULL);
++ spin_unlock_irq(&task->sighand->siglock);
}
static int check_clock(const clockid_t which_clock)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: linux-next: manual merge of the tip tree with the limits tree
2010-04-14 3:59 linux-next: manual merge of the tip tree with the limits tree Stephen Rothwell
@ 2010-04-14 6:41 ` Jiri Slaby
2010-04-14 6:46 ` Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby @ 2010-04-14 6:41 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra,
linux-next, linux-kernel
On 04/14/2010 05:59 AM, Stephen Rothwell wrote:
> Today's linux-next merge of the tip tree got a conflict in
> kernel/posix-cpu-timers.c between commit
> 0c1b5ce8de67c36bbf67db38240a91f358133bdd ("core: add task_struct to
> update_rlimit_cpu") from the limits tree and commit
> f55db609042faecd5e518ce372b87f846659b32e ("cpu-timers: Simplify
> RLIMIT_CPU handling") from the tip tree.
>
> I did the obvious fixup (see below) but it is probably not completely
> correct. Jiri, did I see Linus ask for major revisions of the writable
> limits work?
Hi. Yes, but as I didn't understand the way he described and didn't get
reply to what I asked, please drop the limits tree from -next
completely. If I ever get it into a usable state I'll apply you to merge
it again (or ask akpm again).
thanks,
--
js
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: linux-next: manual merge of the tip tree with the limits tree
2010-04-14 6:41 ` Jiri Slaby
@ 2010-04-14 6:46 ` Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2010-04-14 6:46 UTC (permalink / raw)
To: Jiri Slaby
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra,
linux-next, linux-kernel, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
Hi Jiri,
On Wed, 14 Apr 2010 08:41:00 +0200 Jiri Slaby <jirislaby@gmail•com> wrote:
>
> Hi. Yes, but as I didn't understand the way he described and didn't get
> reply to what I asked, please drop the limits tree from -next
> completely. If I ever get it into a usable state I'll apply you to merge
> it again (or ask akpm again).
OK, I will remove it tomorrow.
[Andrew, not sure if this will affect you much.]
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* linux-next: manual merge of the tip tree with the limits tree
@ 2009-12-18 22:51 Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-12-18 22:51 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
Cc: linux-next, linux-kernel, Jiri Slaby
Hi all,
Today's linux-next merge of the tip tree got a conflict in
include/linux/sched.h between commit
8c2b7235b952281905e001ad04da365279f4c8ec ("resource: add helpers for
fetching rlimits") from the limits tree and commit
733421516b42c44b9e21f1793c430cc801ef8324 ("sched: Move
TASK_STATE_TO_CHAR_STR near the TASK_state bits") from the tip tree.
Just overlapping changes. I fixed it up (see below) and can carry the fix
as necessary.
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
diff --cc include/linux/sched.h
index fe12211,f2f842d..0000000
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@@ -2594,30 -2601,6 +2601,28 @@@ static inline void mm_init_owner(struc
}
#endif /* CONFIG_MM_OWNER */
+static inline unsigned long task_rlimit(const struct task_struct *tsk,
+ unsigned int limit)
+{
+ return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur);
+}
+
+static inline unsigned long task_rlimit_max(const struct task_struct *tsk,
+ unsigned int limit)
+{
+ return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max);
+}
+
+static inline unsigned long rlimit(unsigned int limit)
+{
+ return task_rlimit(current, limit);
+}
+
+static inline unsigned long rlimit_max(unsigned int limit)
+{
+ return task_rlimit_max(current, limit);
+}
+
- #define TASK_STATE_TO_CHAR_STR "RSDTtZX"
-
#endif /* __KERNEL__ */
#endif
^ permalink raw reply [flat|nested] 5+ messages in thread* linux-next: manual merge of the tip tree with the limits tree
@ 2009-12-04 7:55 Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-12-04 7:55 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
Cc: linux-next, linux-kernel, Naohiro Ooiwa, Jiri Slaby
Hi all,
Today's linux-next merge of the tip tree got a conflict in
kernel/signal.c between commit 65193106e8d5ae20156909c6f050aae272035e07
("core: use helpers for rlimits") from the limits tree and commit
f84d49b218b7d4c6cba2e0b41f24bd4045403962 ("signal: Print warning message
when dropping signals") from the tip tree.
Just some context changes. I fixed it up (see below) and can carry the
fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
diff --cc kernel/signal.c
index 74dfa5f,6b982f2..0000000
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@@ -207,10 -225,15 +225,15 @@@ __sigqueue_alloc(int sig, struct task_s
*/
user = get_uid(__task_cred(t)->user);
atomic_inc(&user->sigpending);
+
if (override_rlimit ||
atomic_read(&user->sigpending) <=
- task_rlimit(t, RLIMIT_SIGPENDING))
- t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) {
++ task_rlimit(t, RLIMIT_SIGPENDING)) {
q = kmem_cache_alloc(sigqueue_cachep, flags);
+ } else {
+ print_dropped_signal(sig);
+ }
+
if (unlikely(q == NULL)) {
atomic_dec(&user->sigpending);
free_uid(user);
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-14 6:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14 3:59 linux-next: manual merge of the tip tree with the limits tree Stephen Rothwell
2010-04-14 6:41 ` Jiri Slaby
2010-04-14 6:46 ` Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2009-12-18 22:51 Stephen Rothwell
2009-12-04 7:55 Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox