public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* mlock(2) man page modifications
       [not found] ` <9debc4410809240747h5e74e3eft39f4231db0d9cf2c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2008-09-24 14:49   ` Maxin John
  2008-09-25  9:16   ` Michael Kerrisk
  1 sibling, 0 replies; 3+ messages in thread
From: Maxin John @ 2008-09-24 14:49 UTC (permalink / raw)
  To: linux-man-u79uwXL29TY76Z2rM5mHXA

Dear Michael,

   As per the mlock(2) implementation bugfix which is present in
Linux 2.6.27-rc2 git commit,
(http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a477097d9c37c1cf289c7f0257dffcfa42d50197),
the mlock(2) man page should be modified to reflect the latest changes
in the kernel.

See the LKML thread regarding this commit :
http://www.nabble.com/mlock()-return-value-issue-in-kernel-2.6.23.17-td18751601.html

This patch modifies the mlock(2) behaviour as per the SUSv3 specification.

[ENOMEM]
   Some or all of the address range specified by the addr and
   len arguments does not correspond to valid mapped pages
   in the address space of the process.

[EAGAIN]
   Some or all of the memory identified by the operation could not
   be locked when the call was made.


Patch for the mlock.2 to include information about EAGAIN.
==========================================================

diff -uNr man-pages-3.10/man2/mlock.2 man-pages-3.10_mlock/man2/mlock.2
--- man-pages-3.10/man2/mlock.2 2008-09-23 19:22:25.000000000 +0530
+++ man-pages-3.10_mlock/man2/mlock.2   2008-09-24 19:38:27.786315672 +0530
@@ -175,6 +175,10 @@
 .B ENOMEM
 Some of the specified address range does not correspond to mapped
 pages in the address space of the process.
+.TP
+.B EAGAIN
+Some of the memory identified by the operation could not be locked when
+the function call was made.
 .LP
 For
 .BR mlockall ():

=================================================================

Signed-off-by: Maxin B. John <maxin.john-qujY0cBTTHtBDgjK7y7TUQ@public.gmane.org>

Kindly let me know if there are any issues with respect to this modification.

Thanks and Regards,

Maxin B. John
Sony India Software Center
Bangalore, India
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: mlock(2) man page modifications
       [not found] ` <9debc4410809240747h5e74e3eft39f4231db0d9cf2c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2008-09-24 14:49   ` mlock(2) man page modifications Maxin John
@ 2008-09-25  9:16   ` Michael Kerrisk
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Kerrisk @ 2008-09-25  9:16 UTC (permalink / raw)
  To: Maxin John
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	kosaki.motohiro-+CUm20s59erQFUHtdCDX3A

Hi Maxin, Kosaki,

>    As per the mlock(2) implementation bugfix which is present in
> Linux 2.6.27-rc2 git commit,
> (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a477097d9c37c1cf289c7f0257dffcfa42d50197),
> the mlock(2) man page should be modified to reflect the latest changes
> in the kernel.
>
> See the LKML thread regarding this commit :
> http://www.nabble.com/mlock()-return-value-issue-in-kernel-2.6.23.17-td18751601.html
>
> This patch modifies the mlock(2) behaviour as per the SUSv3 specification.
>
> [ENOMEM]
>    Some or all of the address range specified by the addr and
>    len arguments does not correspond to valid mapped pages
>    in the address space of the process.
>
> [EAGAIN]
>    Some or all of the memory identified by the operation could not
>    be locked when the call was made.

Thanks for your patch!  (Kosaki, thanks for your additional comments.)

A few pointers for future patches:

* Your subject line was good, but could have been even more
descriptive.  I changed the patch title to: mlock.2: Add EAGAIN error.

* It's best to make the patch the very last piece of the message: put
the Signed-off-by and other text above the patch.  This makes the mail
easier for me to read, and to process in git.

I've applied your patch for 3.11.

Cheers,

Michael

> Patch for the mlock.2 to include information about EAGAIN.
> ==========================================================
>
> diff -uNr man-pages-3.10/man2/mlock.2 man-pages-3.10_mlock/man2/mlock.2
> --- man-pages-3.10/man2/mlock.2 2008-09-23 19:22:25.000000000 +0530
> +++ man-pages-3.10_mlock/man2/mlock.2   2008-09-24 19:38:27.786315672 +0530
> @@ -175,6 +175,10 @@
>  .B ENOMEM
>  Some of the specified address range does not correspond to mapped
>  pages in the address space of the process.
> +.TP
> +.B EAGAIN
> +Some of the memory identified by the operation could not be locked when
> +the function call was made.
>  .LP
>  For
>  .BR mlockall ():
>
> =================================================================
>
> Signed-off-by: Maxin B. John <maxin.john-qujY0cBTTHtBDgjK7y7TUQ@public.gmane.org>
>
> Kindly let me know if there are any issues with respect to this modification.
>
> Thanks and Regards,
>
> Maxin B. John
> Sony India Software Center
> Bangalore, India
>



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* FW: mlock(2) man page modifications
       [not found]   ` <20080925145503.3552.KOSAKI.MOTOHIRO-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
@ 2008-09-25  9:47     ` Maxin John
  0 siblings, 0 replies; 3+ messages in thread
From: Maxin John @ 2008-09-25  9:47 UTC (permalink / raw)
  To: linux-man-u79uwXL29TY76Z2rM5mHXA

Hi all,

          I am forwarding the comments by Mr.Kosaki to the mailing
list. It was due to a mistake from my side as I have used
man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org for my first mail and later corrected it.

Best regards and thanks for the Comments,

Maxin B. John
Sony India Software Center
Bangalore, India


---------- Forwarded message ----------
From: KOSAKI Motohiro <kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Date: Thu, Sep 25, 2008 at 11:34 AM
Subject: Re: mlock(2) man page modifications
To: Maxin John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org, Michael Kerrisk
<mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>, man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org


Hi Maxin,

Thank you for your attention.
I think your point and your patch are right.

However, my patch is trivial regression fix, not behavior change.
An older kernel can return EAGAIN at memory stavation.
my patch has following hunk.

> +++ b/mm/mlock.c
> @@ -78,8 +78,6 @@ success:
>
>         mm->locked_vm -= pages;
>  out:
> -       if (ret == -ENOMEM)
> -               ret = -EAGAIN;

In addition, 2.6.11 (oldest code of git repository) has following code.


static int mlock_fixup(struct vm_area_struct * vma,
       unsigned long start, unsigned long end, unsigned int newflags)
{
(snip)
       vma->vm_mm->locked_vm -= pages;
out:
       if (ret == -ENOMEM)
               ret = -EAGAIN;
       return ret;
}


that behavior is linux mlock's behavior for long long time.

Thanks!



> Dear Michael,
>
>     As per the mlock(2) implementation bugfix which is present in
> Linux 2.6.27-rc2 git commit,
> (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a477097d9c37c1cf289c7f0257dffcfa42d50197),
> the mlock(2) man page should be modified to reflect the latest changes
> in the kernel.
>
> See the LKML thread regarding this commit :
> http://www.nabble.com/mlock()-return-value-issue-in-kernel-2.6.23.17-td18751601.html
>
> This patch modifies the mlock(2) behaviour as per the SUSv3 specification.
>
> [ENOMEM]
>     Some or all of the address range specified by the addr and
>     len arguments does not correspond to valid mapped pages
>     in the address space of the process.
>
> [EAGAIN]
>     Some or all of the memory identified by the operation could not
>     be locked when the call was made.
>
>
> Patch for the mlock.2 to include information about EAGAIN.
> ==========================================================
>
> diff -uNr man-pages-3.10/man2/mlock.2 man-pages-3.10_mlock/man2/mlock.2
> --- man-pages-3.10/man2/mlock.2 2008-09-23 19:22:25.000000000 +0530
> +++ man-pages-3.10_mlock/man2/mlock.2   2008-09-24 19:38:27.786315672 +0530
> @@ -175,6 +175,10 @@
>  .B ENOMEM
>  Some of the specified address range does not correspond to mapped
>  pages in the address space of the process.
> +.TP
> +.B EAGAIN
> +Some of the memory identified by the operation could not be locked when
> +the function call was made.
>  .LP
>  For
>  .BR mlockall ():
>
> =================================================================
>
> Signed-off-by: Maxin B. John <maxin.john-qujY0cBTTHtBDgjK7y7TUQ@public.gmane.org>
>
> Kindly let me know if there are any issues with respect to this modification.
>
> Thanks and Regards,
>
> Maxin B. John
> Sony India Software Center
> Bangalore, India
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2008-09-25  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <9debc4410809240747h5e74e3eft39f4231db0d9cf2c@mail.gmail.com>
     [not found] ` <9debc4410809240747h5e74e3eft39f4231db0d9cf2c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-24 14:49   ` mlock(2) man page modifications Maxin John
2008-09-25  9:16   ` Michael Kerrisk
     [not found] ` <20080925145503.3552.KOSAKI.MOTOHIRO@jp.fujitsu.com>
     [not found]   ` <20080925145503.3552.KOSAKI.MOTOHIRO-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-09-25  9:47     ` FW: " Maxin John

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