lkml.org 
[lkml]   [2008]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH, RFC, v2] shmat: introduce flag SHM_MAP_HINT
On Tue, Oct 07, 2008 at 10:20:30AM +0200, Andi Kleen wrote:
> On Tue, Oct 07, 2008 at 09:57:50AM +0300, Kirill A. Shutemov wrote:
> > It allows interpret attach address as a hint, not as exact address.
>
> Please expand the description a bit. Rationale. etc.
>
> > @@ -55,6 +55,7 @@ struct shmid_ds {
> > #define SHM_RND 020000 /* round attach address to SHMLBA boundary */
> > #define SHM_REMAP 040000 /* take-over region on attach */
> > #define SHM_EXEC 0100000 /* execution access */
> > +#define SHM_MAP_HINT 0200000 /* interpret attach address as a hint */
>
> search hint

Ok.

> > @@ -892,7 +892,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
> > sfd->vm_ops = NULL;
> >
> > down_write(&current->mm->mmap_sem);
> > - if (addr && !(shmflg & SHM_REMAP)) {
> > + if (addr && !(shmflg & (SHM_REMAP|SHM_MAP_HINT))) {
>
> I think you were right earlier that it can be just deleted, so why don't
> you just do that?

I want say that we shouldn't do this check if shmaddr is a search hint.
I'm not sure that check is unneeded if shmadd is the exact address.

--
Regards, Kirill A. Shutemov
+ Belarus, Minsk
+ ALT Linux Team, http://www.altlinux.com/
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2008-10-07 12:11    [W:0.150 / U:0.036 seconds]
©2003-2014 Jasper Spaans. hosted at Digital Ocean