From patchwork Fri Dec 13 22:23:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22390 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C8B6523FBA for ; Fri, 13 Dec 2013 22:26:45 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf4758860yho.4 for ; Fri, 13 Dec 2013 14:26:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=LI4Yj8IrwKhfo0X0ZEYUFvxBQVHkyLBAfaHhm8ndrEo=; b=UqCVTQUmTvXiPUomETDC5h68tSeDrq8t4UfJOSktOQ9UP2IGiqtRa2oUkW5SD4+z1B JRg+zMZyYtSJ9Hk2xDCZ4hLVosOG42aVqoYXJjuowZtJMQ7HtLntALvJk1CgCMUrOW7a pbeDdq0j/K4PnrvS0A949LO1lhrR+Xj9XEPNPa2Z2SGS21OIQibY2vS/vFmy8z18awEO 779km/zLHakK26/4QS5xzM0mp+FiunQT+P6xA2HYkEwUcfWFYHjAMTpk4i8r5iN4PAx8 HlSIXWIf7A+8oJVAnIl4kyN0UrS4c1d5s875PKNIuGgR6pUDL0Ov26AESE8akTWZAy3L /Dng== X-Gm-Message-State: ALoCoQkfwfyOek//y8hXa3daqsca8bGIQG9/Tsu57ofA07esVbuASz/yEHrcspLARHSgDma9aK5F X-Received: by 10.58.46.36 with SMTP id s4mr1739179vem.18.1386973605620; Fri, 13 Dec 2013 14:26:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.175 with SMTP id nh15ls1218762qeb.9.gmail; Fri, 13 Dec 2013 14:26:45 -0800 (PST) X-Received: by 10.58.96.15 with SMTP id do15mr2191485veb.56.1386973605365; Fri, 13 Dec 2013 14:26:45 -0800 (PST) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id df13si269808vec.72.2013.12.13.14.26.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db12so1813053veb.22 for ; Fri, 13 Dec 2013 14:26:45 -0800 (PST) X-Received: by 10.52.0.9 with SMTP id 9mr1831980vda.47.1386973605298; Fri, 13 Dec 2013 14:26:45 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp73490vcz; Fri, 13 Dec 2013 14:26:44 -0800 (PST) X-Received: by 10.68.6.66 with SMTP id y2mr6107447pby.60.1386973604554; Fri, 13 Dec 2013 14:26:44 -0800 (PST) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id sj5si2482339pab.284.2013.12.13.14.26.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so3029278pdi.19 for ; Fri, 13 Dec 2013 14:26:44 -0800 (PST) X-Received: by 10.68.88.37 with SMTP id bd5mr6094239pbb.53.1386973604177; Fri, 13 Dec 2013 14:26:44 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qz9sm7457908pbc.3.2013.12.13.14.26.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:43 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , Rebecca Schultz Zavin , John Stultz Subject: [PATCH 025/115] gpu: ion: Switch to using kmalloc rather than kmap during allocation Date: Fri, 13 Dec 2013 14:23:59 -0800 Message-Id: <1386973529-4884-26-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Rebecca Schultz Zavin Previously, metadata was stored in the allocated pages themselves during allocation. However the system can only have a limited number of kmapped pages. A very large allocation might exceed this limit. Signed-off-by: Rebecca Schultz Zavin [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_system_heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 7397bc4..2fb9a64 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -46,7 +46,7 @@ static struct page_info *alloc_largest_available(unsigned long size) if (!page) continue; split_page(page, orders[i]); - info = kmap(page); + info = kmalloc(sizeof(struct page_info *), GFP_KERNEL); info->page = page; info->order = orders[i]; return info; @@ -93,7 +93,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap, } list_del(&info->list); memset(info, 0, sizeof(struct page_info)); - kunmap(page); + kfree(info); } dma_sync_sg_for_device(NULL, table->sgl, table->nents, @@ -107,7 +107,7 @@ err: list_for_each_entry(info, &pages, list) { for (i = 0; i < (1 << info->order); i++) __free_page(info->page + i); - kunmap(info->page); + kfree(info); } return -ENOMEM; }