Received: by 10.223.176.5 with SMTP id f5csp901458wra; Fri, 2 Feb 2018 07:58:44 -0800 (PST) X-Google-Smtp-Source: AH8x224ogPSGWpYoXQsCsjZqK6pKL4dewnAgM1xMLoT18VMTN562DQLIOKO35Ztm2IxmJlFDts+e X-Received: by 10.98.66.152 with SMTP id h24mr40424272pfd.13.1517587124567; Fri, 02 Feb 2018 07:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517587124; cv=none; d=google.com; s=arc-20160816; b=pYb3V8cluXL6MeZMPqgNKy5C6D4RNbca2/3phswU6QkV89GgWaRM0sNWibcNNneZAY D8CSTSOedoxL/aD1QQP+txYUbL0e9a64JNnMuJd75MVgNjUQ1RjHnwJooPtQcjlulZO6 wuHUlN7IRFSXzvX0Qrys+CpffxNIjD0yuIpkRCWpJ7WSxChAVg54tO6oo1tnDcKqM6VY B84KloPXRmWFETdCqiARYTSwI9aG+ZBt2/dmOzj4MKgGyE87ej7tBHSVxqFp8pHD/7fK xZUf8qZQRW9SAhOx2bilcwcrKm9fSewfaviXhiv8gEwtQBqZ5FNWqTPtbJOTRQzX4XVo BadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=1g7Nbsuwc/kOI+75/otZNS3Ko6Szeh+z6hva4mH7z3U=; b=Kx7T+xJzhFW9OV/fILFxAQnTptqPNDTKfCE3OOjY3VwKR4Gy9yZmY21wPiUmWvab8k 6GpMRQPz1oLdMCZ7FOdymPcC1lVOfG9I64fh/A6gTKA5ylGBcl+nY4g0AfGgh2HSkApy NW66xe4/nv9toPRMHsoYJsQkU6Py1TvDDMnABK9WKmbayCUBOd0H486YzBYjrWT5hNTc o7J2vKbe6+Bp4x+gaSCI7w73IttZK1n5MEdUNJ2SfhTnKqVDsHZ74dvSFX51dn78/RDp o5YG8UIcNsWG6ngsxaNotJ+AkCSe2Nt+nrmY0shZxB+n+HtGkUnd3arUG+DVYXe+CC8O x/Rg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b187si1986859pfg.66.2018.02.02.07.58.29; Fri, 02 Feb 2018 07:58:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbeBBP4m (ORCPT + 99 others); Fri, 2 Feb 2018 10:56:42 -0500 Received: from lhrrgout.huawei.com ([194.213.3.17]:24868 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751569AbeBBP4h (ORCPT ); Fri, 2 Feb 2018 10:56:37 -0500 Received: from LHREML714-CAH.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 0086FAFF07425; Fri, 2 Feb 2018 15:56:33 +0000 (GMT) Received: from [10.122.225.51] (10.122.225.51) by smtpsuk.huawei.com (10.201.108.37) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 2 Feb 2018 15:56:34 +0000 Subject: Re: [PATCH 5/6] Documentation for Pmalloc To: Jonathan Corbet CC: , , , , , , , , , , References: <20180130151446.24698-1-igor.stoppa@huawei.com> <20180130151446.24698-6-igor.stoppa@huawei.com> <20180130100852.2213b94d@lwn.net> From: Igor Stoppa Message-ID: <56eb3e0d-d74d-737a-9f85-fead2c40c17c@huawei.com> Date: Fri, 2 Feb 2018 17:56:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180130100852.2213b94d@lwn.net> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.122.225.51] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the review and apologies for the delay. Replies inlined below. On 30/01/18 19:08, Jonathan Corbet wrote: > On Tue, 30 Jan 2018 17:14:45 +0200 > Igor Stoppa wrote: [...] > Please don't put plain-text files into core-api - that's a directory full ok >> diff --git a/Documentation/core-api/pmalloc.txt b/Documentation/core-api/pmalloc.txt >> new file mode 100644 >> index 0000000..934d356 >> --- /dev/null >> +++ b/Documentation/core-api/pmalloc.txt >> @@ -0,0 +1,104 @@ > > We might as well put the SPDX tag here, it's a new file. ok, this is all new stuff to me ... I suppose I should do it also for all the other new files I create But what is the license for the documentation? It's not code, so GPL seems wrong. Creative commons? I just noticed a patch for checkpatch.pl about SPDX and asked the same question there. https://lkml.org/lkml/2018/2/2/365 >> +============================ >> +Protectable memory allocator >> +============================ >> + >> +Introduction >> +------------ [...] > This is all good information, but I'd suggest it belongs more in the 0/n > patch posting than here. The introduction of *this* document should say > what it actually covers. ok > >> + >> +Design >> +------ [...] >> +To keep it to a minimum, locking is left to the user of the API, in >> +those cases where it's not strictly needed. > > This seems like a relevant and important aspect of the API that shouldn't > be buried in the middle of a section talking about random things. I'll move it to the Use section. [...] >> +Use >> +--- >> + >> +The typical sequence, when using pmalloc, is: >> + >> +1. create a pool >> +2. [optional] pre-allocate some memory in the pool >> +3. issue one or more allocation requests to the pool >> +4. initialize the memory obtained >> + - iterate over points 3 & 4 as needed - >> +5. write protect the pool >> +6. use in read-only mode the handlers obtained through the allocations >> +7. [optional] destroy the pool > > So one gets this far, but has no actual idea of how to do these things. > Which leads me to wonder: what is this document for? Who are you expecting > to read it? I will add a reference to the selftest file. In practice it can also work as example. > You could improve things a lot by (once again) going to RST and using > directives to bring in the kerneldoc comments from the source (which, I > note, do exist). But I'd suggest rethinking this document and its > audience. Most of the people reading it are likely wanting to learn how to > *use* this API; I think it would be best to not leave them frustrated. ok, the example route should be more explicative. -- thanks again for the review, igor