From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbbE0VTL (ORCPT ); Wed, 27 May 2015 17:19:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57606 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751847AbbE0VTJ (ORCPT ); Wed, 27 May 2015 17:19:09 -0400 Date: Wed, 27 May 2015 14:19:08 -0700 From: Andrew Morton To: Joe Perches Cc: LKML Subject: Re: [RFC patch] vsprintf: Add %pav extension for print_vma_addr Message-Id: <20150527141908.4cf02ef4456201ad7db78883@linux-foundation.org> In-Reply-To: <1432760971.2846.180.camel@perches.com> References: <1432681504.2846.116.camel@perches.com> <20150527140406.bcc33ecc79da09ad6782b971@linux-foundation.org> <1432760971.2846.180.camel@perches.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 May 2015 14:09:31 -0700 Joe Perches wrote: > > Problems when CONFIG_PREEMPT=n. > > > > > + down_read(&mm->mmap_sem); > > > + vma = find_vma(mm, ip); > > > + if (vma && vma->vm_file) { > > > + struct file *f = vma->vm_file; > > > + char *gfp_buf = (char *)__get_free_page(GFP_KERNEL); > > > > We shouldn't assume we can use GFP_KERNEL here. Even if the > > preempt_count() worked, we might be in a context which requires > > GFP_NOFS or GFP_NOIO. > > This code is basically a copy of the existing print_vma_addr() > so is that true for all the existing uses too? Yeah, the current code is pretty junky. But normally print_vma_addr() should never be called so nobody noticed... In e8bff74a Ingo did a fiddle to preempt_conditional_sti() which looks like it will address the CONFIG_PREEMPT=n issue, but only on x86.