From: Jeff Layton Subject: page allocation in nfs_symlink Date: Thu, 7 Jun 2007 09:18:42 -0400 Message-ID: <20070607091842.09c23fd8.jlayton@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: nfs@lists.sourceforge.net Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1HwHt6-0000T7-SH for nfs@lists.sourceforge.net; Thu, 07 Jun 2007 06:18:53 -0700 Received: from mx2.redhat.com ([66.187.237.31]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1HwHt8-000516-Q8 for nfs@lists.sourceforge.net; Thu, 07 Jun 2007 06:18:56 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx2.redhat.com (8.13.1/8.13.1) with ESMTP id l57DIhsu020430 for ; Thu, 7 Jun 2007 09:18:43 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l57DIgin001941 for ; Thu, 7 Jun 2007 09:18:42 -0400 Received: from tupile.connectathon.org (vpn-14-94.rdu.redhat.com [10.11.14.94]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l57DIfWk022759 for ; Thu, 7 Jun 2007 09:18:42 -0400 List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net I was reviewing a patch the other day and noticed this in recent versions of nfs_symlink(): page = alloc_page(GFP_KERNEL); if (!page) { unlock_kernel(); return -ENOMEM; } kaddr = kmap_atomic(page, KM_USER0); memcpy(kaddr, symname, pathlen); if (pathlen < PAGE_SIZE) memset(kaddr + pathlen, 0, PAGE_SIZE - pathlen); kunmap_atomic(kaddr, KM_USER0); I'm a bit confused and so am hoping someone can clarify. If we're allocating a GFP_KERNEL page, then it should be directly addressable by the kernel (via page_address()). So we really shouldn't need to use a kmap/unmap here, right? Also, it looks like most pagecache pages are allocated using GFP_HIGHUSER. Is there something special about symlinks that means that we need to use normal zone pages here? While I haven't tested it, it seems like we ought to be able to do alloc_page(GFP_HIGHUSER) here instead. Am I missing something? Thanks, -- Jeff Layton ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs