From patchwork Thu Jan 24 01:29:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Lespinasse X-Patchwork-Id: 2027581 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E2EBE3FD86 for ; Thu, 24 Jan 2013 01:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753547Ab3AXBbv (ORCPT ); Wed, 23 Jan 2013 20:31:51 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:59018 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158Ab3AXBaC (ORCPT ); Wed, 23 Jan 2013 20:30:02 -0500 Received: by mail-pa0-f51.google.com with SMTP id fb11so5128802pad.38 for ; Wed, 23 Jan 2013 17:30:01 -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=uFr/RtBdWHW+ZgsI4UFlu+D1DQWsWwfIDN7E9w9s5ps=; b=VWfaIGzZHI1jRhVHjnxMuk3FCvVMeZ2BvChJSqWb+U4jIkQkd2EdD+gKePG/+yzdW6 SYyndPWFw7P79ImfIGZemk4YVKPGsygwsT177tmXsgKca/CdbAGLaHgEFMeePluZueNT U2x3kWRFZuzyRHSKCspka1A4a0cHIUUgu4/uB6wrZpd7dD84Mb6roeiKH1lW41H+csgl M7KSbkp8QRm4gayLpyDB2Fp7MbT8R3LfNIJaUuF22sga4+NI90eribRotBrg+fD91MOR igxhsxLix37/SkBotsV1r5VvvpGdXL3z4YjxgyWhgvBsQ6sdA0+jjITIwcD+uG9stsMr qAJg== 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=uFr/RtBdWHW+ZgsI4UFlu+D1DQWsWwfIDN7E9w9s5ps=; b=GVbi23bWX5yS7esTDrmyQtO6cJgh8EjSLFhhBFlt2QQGNG0QPu7i/DlvMmEht+npBn xIY4SjQn4UVjCHpJjVLMFW8kfeYUV2nFMHkH4Jgv6a4LQOzQksZJgFwOcPdrGIPcDdjF yRfkpIthsPuo/PmjURoIlSSAwpxUF83cs5YDcZtLu/6kHK0J5j9oA3/T0ewgO+cvH7S4 wpxr7xap9oGIn2GbGtC4JXcndqUvVkfWEJcQuaFKCHZs52ac4/ZaVqQ06oDA4wb89TkS sHQIxqv6tPNT8oLLMFZS/5OIFfOpDc+Xtaz+PhrSEkA2iYOIKW/e2taw7ybEtj+dwY7q 7+ZA== X-Received: by 10.68.138.195 with SMTP id qs3mr561652pbb.62.1358991001070; Wed, 23 Jan 2013 17:30:01 -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 kc4sm13786285pbc.23.2013.01.23.17.29.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 17:30:00 -0800 (PST) From: Michel Lespinasse To: Benjamin Herrenschmidt , Paul Mackerras , "James E.J. Bottomley" , Helge Deller , Richard Henderson , Ivan Kokshaysky , Matt Turner , David Howells , Tony Luck , Fenghua Yu 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: Wed, 23 Jan 2013 17:29:45 -0800 Message-Id: <1358990991-21316-3-git-send-email-walken@google.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1358990991-21316-1-git-send-email-walken@google.com> References: <1358990991-21316-1-git-send-email-walken@google.com> X-Gm-Message-State: ALoCoQnU45XLcB4xj+ItzpOMft1H3VRCsEbrdKG016ZwI4N9mA3BBXWLX67EGsF5A9uaUv8zWRYMnDyU1QPI8IJa9IGPmstzoWs/PDPLAxrhMvFGTSr1lpwAndXq0SpqZyRjGupOQywzgfdNxEPaU5QwsdtRc6ySZmbnI4FlVu5p5wBjl8FfgbVzQwbau4MzqROzp6erpDqjleuF8ThHt7UwC7kZ0J7uWg== 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 --- 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