lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 17 Jan 2014 11:54:09 -0800
From:	Andy Lutomirski <luto@...capital.net>
To:	Alex Thorlton <athorlton@....com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Rik van Riel <riel@...hat.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Oleg Nesterov <oleg@...hat.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Kees Cook <keescook@...omium.org>,
	Andrea Arcangeli <aarcange@...hat.com>
Subject: Re: [RFC PATCHv2 1/2] Add mm flag to control THP

On Thu, Jan 16, 2014 at 1:01 PM, Alex Thorlton <athorlton@....com> wrote:
> This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent
> hugepages using prctl.
>

> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -1998,6 +1998,17 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
>                 if (arg2 || arg3 || arg4 || arg5)
>                         return -EINVAL;
>                 return current->no_new_privs ? 1 : 0;
> +       case PR_SET_THP_DISABLE:
> +               if (arg2)
> +                       set_bit(MMF_THP_DISABLE, &me->mm->flags);
> +               else
> +                       clear_bit(MMF_THP_DISABLE, &me->mm->flags);
> +               break;
> +       case PR_GET_THP_DISABLE:
> +               error = put_user(test_bit(MMF_THP_DISABLE,
> +                                &me->mm->flags),
> +                                (int __user *) arg2);
> +               break;

Usual nit: please return -EINVAL if unused args are nonzero.  This
makes it possible to extend these APIs in the future.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists