Received: by 10.223.185.116 with SMTP id b49csp2935876wrg; Mon, 5 Mar 2018 11:02:51 -0800 (PST) X-Google-Smtp-Source: AG47ELvoWp8hNkBsbHdK7QakZE8a7WLP+TJ/O6AqgQaODDfM+tKyz0kvhGvy5viT7J5sdzPVbntZ X-Received: by 10.98.174.16 with SMTP id q16mr16150178pff.92.1520276570977; Mon, 05 Mar 2018 11:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520276570; cv=none; d=google.com; s=arc-20160816; b=DvmSwcI89XtpmAf28mjQcZrFNb8FWcE17cm/ZWuiD2fURIxShVMRnLd2dEWV9XaD41 Hbfsp7SiPZVF7omFfkFX+rD4C+4rxwGWL1CuKbnddzPd5bD44Yrn/2vjwkV36gUDxzyN PJmiSQFCIh6efkPnyjBcdcBne/CxDXyHwNejls5qRd5vnieRI8WMiasIbrcntdwAe4U3 K/5mOYHO5KPSTHsVffCe8aL73UeOu4YQMavsgOY7nWVJdl9/Yv8bOQgnQMKXtpsuFj8l 8nZSJjW9V+zbUXlXbbujw/yfGzharZju2pp5onKPTFGXvzhh4QdppZhd098jPzbuwitJ RS0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=49bpFsR4huWIYzQJ2AykurKnAUr4JOSqgVr0n9HMoxE=; b=cc5WsrkDIYrUp3dEqNMsdtTKAj/uNAa431xvC1MmHccqZadfwARkeSwIESJ3c6FQYh PrfdLx6SzjhbGlLdUAVy2bGUlm4kegHWsSc+NJ2WMIMvBa7gyTFFoTCilxRBzy9tpSxY 8QzWLYocpxsdJ0pz1at3gPb8+5Gr14ThrxuBRjAAzJTVVdD+K285LJ+yOY0fD87KHGBO /SyKPQ0ar2BLJVfEknjiTEQOxwiBUxI4kEInkpNV2qBBMi/lR/zd/5LyfkL5b/H6LOnD eMSSWrX3hvzts/wnW4NUkxcsEGdiJUXwHLcpqMB1Kli0SrXpJnGdix5tdnv2UplB6854 c1tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f+n0heH4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u190si8690253pgc.532.2018.03.05.11.02.36; Mon, 05 Mar 2018 11:02:50 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=f+n0heH4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784AbeCETAO (ORCPT + 99 others); Mon, 5 Mar 2018 14:00:14 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35379 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbeCETAM (ORCPT ); Mon, 5 Mar 2018 14:00:12 -0500 Received: by mail-pl0-f66.google.com with SMTP id bb3-v6so10230055plb.2; Mon, 05 Mar 2018 11:00:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=49bpFsR4huWIYzQJ2AykurKnAUr4JOSqgVr0n9HMoxE=; b=f+n0heH4a66D79BH8NPCezX0kE0hDGZix9aLEgyv3N5arzPl+QyrjuN0ofmTJXHzoL RmUM3l11dZJk68iNtauUS5wZsyynzszaufDf69X5GpHCE1zT0QMV2KSdY4v3sXk8VTxA sdtZlLh6O203r6Evp0jRAOlXlFCTJUBBDYHD4bCTjQdiZoKU7sYIXR2p2wchZNjaO7p8 nfJ4YF1+Wl/LsuY85ag5irkzHhvdbedy/ic+6P/pZ1DrOmGbLo/Isn8ttf+jIIBUKNEF 8XS0d2GCm6K1F3FcyzuAAA1PdzDiEX5fViOSHNKEZnV1GEmzL10vziTn66bX+JW0r1QI nOgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=49bpFsR4huWIYzQJ2AykurKnAUr4JOSqgVr0n9HMoxE=; b=hBmWD53+O8bhZqK6QsCtmVWN6sBdKbsyxnKa7Zk2eM/iwIZO6RHDmnKEQcEJYj6qdb 2drjQjjngAtenF+TbwG18ooLKW7/lHWRLrDjWFeD005nYnJ/GCjY30o9eIcAsvDVL48l o6/T0Ey/Pa38D/sS9UMgtj/BR71rwyaZnhUxnoObjnCmj+OOLrYJevuyOgpfdQ4GZUu4 bEY86kdjdsMKM6YrbXr//CgRwWfRy8y+Z7o9rouTc7mllrmiOLUvxUirWWsTE32B+zde QCK7qDX4P+lNkZWbpiorcx7EaxBylmyCeAUUDkTYS+D8rUvJ6YZH072KWILnJ8BVE5sM /nqg== X-Gm-Message-State: APf1xPBu+nWbCqvksKrysxH9kGM2VE00IDft2J/U+TcbLnlVRBX7+Bv3 1cl/9SjAih+Im2gxPU1h+bA= X-Received: by 2002:a17:902:b903:: with SMTP id bf3-v6mr14295599plb.316.1520276411991; Mon, 05 Mar 2018 11:00:11 -0800 (PST) Received: from JF-EN-C02V905BHTDF.tld ([12.111.169.54]) by smtp.gmail.com with ESMTPSA id j1sm23135527pff.94.2018.03.05.11.00.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 11:00:11 -0800 (PST) Subject: Re: [PATCH 1/7] genalloc: track beginning of allocations To: Igor Stoppa , david@fromorbit.com, willy@infradead.org, keescook@chromium.org, mhocko@kernel.org Cc: labbott@redhat.com, linux-security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com References: <20180228200620.30026-1-igor.stoppa@huawei.com> <20180228200620.30026-2-igor.stoppa@huawei.com> From: J Freyensee Message-ID: <6a31164a-af3f-91ea-d385-7c6d1888b28c@gmail.com> Date: Mon, 5 Mar 2018 11:00:08 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180228200620.30026-2-igor.stoppa@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org . . On 2/28/18 12:06 PM, Igor Stoppa wrote: > + > +/** > + * gen_pool_dma_alloc() - allocate special memory from the pool for DMA usage > + * @pool: pool to allocate from > + * @size: number of bytes to allocate from the pool > + * @dma: dma-view physical address return value. Use NULL if unneeded. > + * > + * Allocate the requested number of bytes from the specified pool. > + * Uses the pool allocation function (with first-fit algorithm by default). > + * Can not be used in NMI handler on architectures without > + * NMI-safe cmpxchg implementation. > + * > + * Return: > + * * address of the memory allocated - success > + * * NULL - error > + */ > +void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma); > + OK, so gen_pool_dma_alloc() is defined here, which believe is the API line being drawn for this series. so, . . . > > > /** > - * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage > + * gen_pool_dma_alloc() - allocate special memory from the pool for DMA usage > * @pool: pool to allocate from > * @size: number of bytes to allocate from the pool > * @dma: dma-view physical address return value. Use NULL if unneeded. > @@ -342,14 +566,15 @@ EXPORT_SYMBOL(gen_pool_alloc_algo); > * Uses the pool allocation function (with first-fit algorithm by default). > * Can not be used in NMI handler on architectures without > * NMI-safe cmpxchg implementation. > + * > + * Return: > + * * address of the memory allocated - success > + * * NULL - error > */ > void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma) > { > unsigned long vaddr; > > - if (!pool) > - return NULL; > - why is this being removed?  I don't believe this code was getting removed from your v17 series patches. > vaddr = gen_pool_alloc(pool, size); > if (!vaddr) > return NULL; > @@ -362,10 +587,10 @@ void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma) > EXPORT_SYMBOL(gen_pool_dma_alloc); > > Otherwise, looks good, Reviewed-by: Jay Freyensee