Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1004829ybn; Wed, 2 Oct 2019 09:25:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxE2feoBFchLgkA2WUa2jBiIKNREYn91BBJ77j0TZCUuzAvZiiUGFHVDG3mTTia9apF/xJx X-Received: by 2002:a17:906:3110:: with SMTP id 16mr3774828ejx.306.1570033519412; Wed, 02 Oct 2019 09:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570033519; cv=none; d=google.com; s=arc-20160816; b=PRbNVL7cedTdc//X7NmNUdOc5Uwv0DbVWrsT5zbxAM1FeIFywe2LNVah5PkgYI3mqg k/BEXFuZkh0e9AH1kWKyrNccT/oowDDbvLMG05ysAs5esPRF+1eJvTYy7ra5lbSZyQ/C 6lwzPm4fGEOWSl9MhCrbBsiHswE2WDKrbTQsxNSYM5BBNuSsJj/7Jg8Iuf1FCoghbHVZ 8bUPfcESPS1OdVEiCxL6mwuYzNiqCnK5WbaFZ8bIb2S82ZGIyZkr7UcLqYlLvvnJW9x0 yzbtHgFauG2Onv4vzpdj5cEXaZuGjIVvAB/lct8qXmXobgkq2Ctz8GHjomEK7aru8yQ+ JwYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=S3qu0q538RdqSW4iMWABBq0n0em/qJFZBK3KeAdAIbs=; b=tLxekJjWTt7U8pJabehDZrgvWf3u9tNu2Kjn2KX5Y91vfQ4DmXlu7AoQGHHPeuJa6s fH2ByOegYy8MesOboYLzOSRhLH7fcihksCUBE2LJcxd2r1c0bbnGiH/IA+UD8WCYQ3K4 V8QrtEr0+xcgp8FheghLOX3Clnm5GYj9pYRwfELOWLIBb39SRA68dJZU8bhrkqQB7wla c7QYMsm9RSHQvmK5aPRIcN+4q89/5BCr9rz+GHRpcZsAOrNhZ6Y8M2mSeCRy2yGN6PPe LyqKjRlCLBHDpw3j20gpXW2+9oy6V2eCuLUv/leIydiQHbnJOoFTpTbYW889rohBXw1v i99g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gaS1xDR/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si4649023eju.25.2019.10.02.09.24.54; Wed, 02 Oct 2019 09:25:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gaS1xDR/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728442AbfJBQPt (ORCPT + 99 others); Wed, 2 Oct 2019 12:15:49 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35851 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfJBQPs (ORCPT ); Wed, 2 Oct 2019 12:15:48 -0400 Received: by mail-wm1-f66.google.com with SMTP id m18so7608831wmc.1 for ; Wed, 02 Oct 2019 09:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S3qu0q538RdqSW4iMWABBq0n0em/qJFZBK3KeAdAIbs=; b=gaS1xDR/MCIrEusKsbIz4cW1CiyfwYYMFFlkJTvXLn2FJnDVlxHH+o6O9QSz539jQf poU9tqSSIT4rhJv1AqqOp2P/GBzRSdKDr1zpPLCepPY39P9h12Aas1W0n2QKwiAjaB07 KadfdYgX6OlzrAoGlXRjYCckxXgkFIXm4A7C7XWyWqn+fu8OKDEYWyyn1guKySmitHEr sz5J6n8LQlK1iLVLi0fGU7c3TCAukTofg0++XZrbTN0LuCaOUVLSODBPfO5HrKhAVlgw Ac9sOb8KSGmKoUV1bngrp/iZ4VKk1n6ReF8WiDhlrDmvRPwhr2zZ2/e9wQ+JHOzopqxj Lwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S3qu0q538RdqSW4iMWABBq0n0em/qJFZBK3KeAdAIbs=; b=UoM+mgT12EQ/a+CIbSVLJ7VOcy4GUx7sv/LfG7g0jReb/pVxfKy13PbGISsnnMFAyq bOoO6G/WuOaSPjMw8hYNip1t0YWWg+iEUuw3lU7wbQjutQyK0/eLfFsRZS2Jux6XINN+ AxmAkX6a8IYbThqPx/tPkHiCecZxn7ABXaCa9pwHZgC+jWxv/pFo0Ub766ivIbZS5s5O EAbn2zQ5WwIxThezGtBkaNBqHioIXxed1BY/4VUr+Cwl8AldeitXTNRWxvcBTpdFgNZX M0ZF1nY23kR+aCUiZzHbaHZKpWfK3+mUURptU1uV6JLW8pGmKMRVtJHjUg2as+RjTjmN TiWQ== X-Gm-Message-State: APjAAAWqD0yUp+e15HvAAooLd5e1hmZBZKvgtKRXXkk40rLrnZuGJYBG X5jk0tltS6h0f+VsB3d3cp8vzebR+wlqhSJ99PPKQQ== X-Received: by 2002:a1c:9988:: with SMTP id b130mr3697022wme.164.1570032946489; Wed, 02 Oct 2019 09:15:46 -0700 (PDT) MIME-Version: 1.0 References: <20190906184712.91980-1-john.stultz@linaro.org> <20190930081434.248-1-hdanton@sina.com> In-Reply-To: <20190930081434.248-1-hdanton@sina.com> From: John Stultz Date: Wed, 2 Oct 2019 09:15:35 -0700 Message-ID: Subject: Re: [RESEND][PATCH v8 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps To: Hillf Danton Cc: lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , "Andrew F . Davis" , Christoph Hellwig , Chenbo Feng , Alistair Strachan , Hridya Valsaraju , dri-devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 30, 2019 at 1:14 AM Hillf Danton wrote: > On Fri, 6 Sep 2019 18:47:09 +0000 John Stultz wrote: > > > > + cma_pages = cma_alloc(cma_heap->cma, nr_pages, align, false); > > + if (!cma_pages) > > + goto free_buf; > > + > > + if (PageHighMem(cma_pages)) { > > + unsigned long nr_clear_pages = nr_pages; > > + struct page *page = cma_pages; > > + > > + while (nr_clear_pages > 0) { > > + void *vaddr = kmap_atomic(page); > > + > > + memset(vaddr, 0, PAGE_SIZE); > > + kunmap_atomic(vaddr); > > + page++; > > + nr_clear_pages--; > > + } > > + } else { > > + memset(page_address(cma_pages), 0, size); > > + } > > Take a breath after zeroing a page, and a peep at pending signal. Ok. Took a swing at this. It will be in the next revision. Thanks again for the review! -john