From patchwork Wed Jan 9 01:28:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 1950251 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C69B2DF23A for ; Wed, 9 Jan 2013 01:30:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756335Ab3AIB2d (ORCPT ); Tue, 8 Jan 2013 20:28:33 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:45818 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756303Ab3AIB2b (ORCPT ); Tue, 8 Jan 2013 20:28:31 -0500 Received: by mail-pb0-f48.google.com with SMTP id rq13so600608pbb.7 for ; Tue, 08 Jan 2013 17:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=m8BhLQt09z/FIiDqu8x1NEjL2ZCS/TnXPYNPNj+0qyc=; b=Pbv9DeD/S79iRbegg+D14tCm7krsi5TLsptlLWCqhuGM0o0B0o/eittiwuDsIKQvft BHz21T7x4kWyAUFRlKy4EV1Lme/0X6h63tOB8wIcPYEunIre0om04Qz2RsURCYnHcco7 RbBD3+2FXd5Cvj1n29JDkmsSm334SoEOmZMIdkldQLyDiPOZxG5IyZM1uB9qw9G+oTG9 DzXHdPiqqnuDZKxAiahrBgV+7hKh4sHf0/sBi29A4gN4ufs/AyWbTsAJ2sDzUaisSzgW 4/W3ISojCRAGQMrKrCXA2tx0t9KtNcYxdQKWtk6dfOMH88gpAetXKXGGUbh4/Oa3Kt60 ywpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=m8BhLQt09z/FIiDqu8x1NEjL2ZCS/TnXPYNPNj+0qyc=; b=Kdba5E5wJjc2DZQvveM14M9yszzgu+ST3Gy8tBFF95GLSMB14k0GNTv5/rZ1GNGtHx vixUufeF/cgUg+sk5CSyPaDCjlrdX/pipW+X8gKBivpeq6we2Cy+2mVXNBrj22JFgG8F ZHUJrYHmYSFDLKdykCN0g2dITUrOPepanhmvsoOY78w0KmNTNzff7loPscjZ3DLSQigg i+LEumgwalhlhatIKRzJVcZornKGuXQ5Z67igdGF0hzWIGkwWhjTAOYKjHfR46UCJu4q o/DUcGmMGTGiF4T200M4UJ73RegVyTypWPBxzP1/LPhu4pOlcl38da2yQiXNxjAJpi7p j1QA== X-Received: by 10.66.87.202 with SMTP id ba10mr184400937pab.72.1357694910854; Tue, 08 Jan 2013 17:28:30 -0800 (PST) Received: from studio.mtv.corp.google.com (studio.mtv.corp.google.com [172.17.131.106]) by mx.google.com with ESMTPS id p10sm41711168pax.27.2013.01.08.17.28.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 17:28:30 -0800 (PST) From: Michel Lespinasse To: Rik van Riel , Benjamin Herrenschmidt , "James E.J. Bottomley" , Matt Turner , David Howells , Tony Luck Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org Subject: [PATCH 2/8] mm: use vm_unmapped_area() on alpha architecture Date: Tue, 8 Jan 2013 17:28:09 -0800 Message-Id: <1357694895-520-3-git-send-email-walken@google.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1357694895-520-1-git-send-email-walken@google.com> References: <1357694895-520-1-git-send-email-walken@google.com> X-Gm-Message-State: ALoCoQkI//kQ1BD+nEZYr9kxTmPsIxnSRjEgE7N2Nh9aHHiDZeSWA0D9b5x5PVSvuv6hbG5NWehU/bBfaIEQ6oU/ymfmpGjWM4edhZnveeTuTtiTsyuSBkBvlTiGNHpVKxgez17bS8uXsQsbgK8D+BWAz/Lt207Z3k0iLoSZIqvsqDQxhJ7YkINIrsGiaV5w72To7fk/ANK2XQd3pYzJwDwwS0XdZrQOgg== Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Update the alpha arch_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse Acked-by: Rik van Riel Tested-by: Michael Cree --- arch/alpha/kernel/osf_sys.c | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 14db93e4c8a8..ba707e23ef37 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c @@ -1298,17 +1298,15 @@ static unsigned long arch_get_unmapped_area_1(unsigned long addr, unsigned long len, unsigned long limit) { - struct vm_area_struct *vma = find_vma(current->mm, addr); - - while (1) { - /* At this point: (!vma || addr < vma->vm_end). */ - if (limit - len < addr) - return -ENOMEM; - if (!vma || addr + len <= vma->vm_start) - return addr; - addr = vma->vm_end; - vma = vma->vm_next; - } + struct vm_unmapped_area_info info; + + info.flags = 0; + info.length = len; + info.low_limit = addr; + info.high_limit = limit; + info.align_mask = 0; + info.align_offset = 0; + return vm_unmapped_area(&info); } unsigned long