mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: + proc-export-a-processes-resource-limits-via-proc-pid.patch added to -mm tree
@ 2007-08-17 22:22 Oleg Nesterov
  2007-08-18 11:58 ` Neil Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Oleg Nesterov @ 2007-08-17 22:22 UTC (permalink / raw)
  To: Neil Horman, Andrew Morton; +Cc: linux-kernel

Neil Horman wrote:
> 
> +static int proc_pid_limits(struct task_struct *task, char *buffer)
> +{
> +	unsigned int i;
> +	int count = 0;
> +	char *bufptr = buffer;
> +
> +	struct rlimit rlim[RLIM_NLIMITS];
> +
> +	read_lock(&tasklist_lock);
> +	memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS);
> +	read_unlock(&tasklist_lock);

Please don't re-introduce tasklist_lock unless strictly needed. And in this case
it doesn't help, sys_getrlimit() changes ->rlim[] under task_lock().

Hovewer, I think the whole patch is not right. The "tsk" itself is pinned, but its
->signal is not stable and can be == NULL.

You can use lock_task_sighand() to access ->signal.

Oleg.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-19 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-17 22:22 + proc-export-a-processes-resource-limits-via-proc-pid.patch added to -mm tree Oleg Nesterov
2007-08-18 11:58 ` Neil Horman
2007-08-18 12:59   ` Oleg Nesterov
2007-08-18 18:55     ` Neil Horman
2007-08-18 19:03       ` Oleg Nesterov
2007-08-18 23:23         ` Neil Horman
2007-08-19  8:57           ` Oleg Nesterov
2007-08-19 13:03             ` Neil Horman
2007-08-19 15:19               ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®