Re: [patch 3/3] [PATCH] prctl: Add PR_SET_MM codes to set upmm_struct entires v3
From: Cyrill Gorcunov
Date: Mon Dec 12 2011 - 17:01:36 EST
On Mon, Dec 12, 2011 at 01:53:23PM -0800, Andrew Morton wrote:
...
> >
> > +#ifdef CONFIG_CHECKPOINT_RESTORE
> > +static int prctl_set_mm(int opt, unsigned long addr,
> > + unsigned long arg4, unsigned long arg5)
> > +{
> > + unsigned long rlim = rlimit(RLIMIT_DATA);
> > + unsigned long vm_req_flags;
> > + unsigned long vm_bad_flags;
> > + struct vm_area_struct *vma;
> > + int error = 0;
> > +
> > + if (arg4 | arg5)
> > + return -EINVAL;
> > +
> > + if (!capable(CAP_SYS_ADMIN))
> > + return -EPERM;
> > +
> > + if (addr >= TASK_SIZE)
> > + return -EINVAL;
> > +
> > + down_read(¤t->mm->mmap_sem);
>
> This may not be true of all compiler versions, but when I cache
> current->mm in a local, the code size is reduced rather a lot:
>
> akpm:/usr/src/25> size kernel/sys.o
> text data bss dec hex filename
> 22685 14376 7616 44677 ae85 kernel/sys.o
> 22489 14376 7616 44481 adc1 kernel/sys.o
>
Hmm, this is great and weird. Letme try...
Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/