From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757724AbaCTLis (ORCPT ); Thu, 20 Mar 2014 07:38:48 -0400 Received: from www84.your-server.de ([213.133.104.84]:54256 "EHLO www84.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbaCTLiq (ORCPT ); Thu, 20 Mar 2014 07:38:46 -0400 Message-ID: <1395315494.1127.3.camel@vger.seibold.net> Subject: Re: [PATCH] x86, vdso32: fix out of memory handling setup vDSO From: Stefani Seibold To: Thomas Gleixner Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com, hpa@zytor.com, ak@linux.intel.com, aarcange@redhat.com, john.stultz@linaro.org, luto@amacapital.net, xemul@parallels.com, gorcunov@openvz.org, andriy.shevchenko@linux.intel.com, Martin.Runge@rohde-schwarz.com, Andreas.Brief@rohde-schwarz.com Date: Thu, 20 Mar 2014 12:38:14 +0100 In-Reply-To: References: <1395301511-5908-1-git-send-email-stefani@seibold.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Authenticated-Sender: stefani@seibold.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, den 20.03.2014, 10:53 +0100 schrieb Thomas Gleixner: > On Thu, 20 Mar 2014, Stefani Seibold wrote: > > > This patch add a correct out of memory handling for setup a 32 bit vDSO. > > > > The patch is against tip commit 4e40112c4ff6a577dd06d92b2a54cdf06265bf74 > > > > Signed-off-by: Stefani Seibold > > --- > > arch/x86/vdso/vdso32-setup.c | 17 ++++++++++++++++- > > 1 file changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c > > index 0bc363a..e1171c2 100644 > > --- a/arch/x86/vdso/vdso32-setup.c > > +++ b/arch/x86/vdso/vdso32-setup.c > > @@ -134,8 +134,14 @@ int __init sysenter_setup(void) > > } > > > > vdso32_size = (vdso_len + PAGE_SIZE - 1) / PAGE_SIZE; > > - vdso32_pages = kmalloc(sizeof(*vdso32_pages) * vdso32_size, GFP_ATOMIC); > > + > > + vdso32_pages = kmalloc(sizeof(*vdso32_pages) * vdso32_size, GFP_ATOMIC); > > Why is this GFP_ATOMIC and not GFP_ATOMIC ? > > That code is called either from identify_boot_cpu(), where GFP_KERNEL > is perfectly valid and from subsys_initcall(sysenter_setup) which is > way late in the boot process where GFP_KERNEL is the RightThing. > > Aside of that, why do we need to call it early for X86_32 and late for > X86_64? > > We need the vdso before we head off to user space, but not in the > early boot process. > All complains are design decisions not made by me. I will send a patch for the GFP_ATOMIC thing. For the other one it would be the best to ask Andy for the reason. - Stefani