From patchwork Thu Dec 6 21:13:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10716779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E13517DB for ; Thu, 6 Dec 2018 21:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F68B2F217 for ; Thu, 6 Dec 2018 21:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6394A2F21D; Thu, 6 Dec 2018 21:13:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E22C82F217 for ; Thu, 6 Dec 2018 21:13:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DEBC06B7C46; Thu, 6 Dec 2018 16:13:18 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D9CA56B7C48; Thu, 6 Dec 2018 16:13:18 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C63A66B7C49; Thu, 6 Dec 2018 16:13:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id 72EBA6B7C46 for ; Thu, 6 Dec 2018 16:13:18 -0500 (EST) Received: by mail-pf1-f200.google.com with SMTP id p9so1369696pfj.3 for ; Thu, 06 Dec 2018 13:13:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=lyyH4SUNbL+qV4PQ4MvsIqjFPayEORBiISRr4fYofeM=; b=N7wcOP8/nQ0tmYV+BX34cO8BNNjwruVBaWL0/2wUxUOGU3nc1cFxwgMy+nAbCytJKG 3WXtx+3HCuf3RKyiGHl6HZPJ9ZaZnI4FxJwC41SjQYYcpErdPIiS7X3eGtto6wVdkPNn d+32pngoM+Az8keizXqZtkoAMFFlBkB6Ckn+OBTnhRJd+nqIclNM4wJN136qa4fn89Kg IBVdjeyxZU3JUzwR38WBgsP1XHg845UL8lNmZlJja9zUGNWm0/wGz9UeKATVbdwR+jkS wOv1YK16CO1w3vFiwUOc4nulrRqDZrFtFepcOQhP8qmlZr4mR7kebJ3empIBZXw88Dq1 MzCQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AA+aEWanLp0kW5SrE/tEX7Ix3SPQH+WWEWgFgrPZGEL5Hd+4BnBHKc9z uqnEC+Q2ybV58xOgoeqqFyMYf+4v1ilKNrMf4/vCoTTiI1trekLLq6eubGQqn+pvbrjciZeosLu HiktHtMoNibfQNjvpt+uKQzWtzpoYiunOAWqbCUvhUl/x3tdWdbnyYR8CpaxJp5Dcyg== X-Received: by 2002:a62:f5da:: with SMTP id b87mr30673244pfm.253.1544130798096; Thu, 06 Dec 2018 13:13:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/WGN4KCj5eF8loXjHGEgwywKiP+BOFR6nh2ZrUZ21WVAKC0N2/rH20WvGUWbcTIXVvhRgIx X-Received: by 2002:a62:f5da:: with SMTP id b87mr30673181pfm.253.1544130797204; Thu, 06 Dec 2018 13:13:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544130797; cv=none; d=google.com; s=arc-20160816; b=chrxAJCOxYRR61LvWonEftwpOG1uCwYTYyXpNmorL9kfjJODnilm37FB3ec7k2Hm8p xNyoyJSoLVq7+3Fm4C1fLmlLM9LAAxu8ROtUL2aSbo4ma73cCIErEJqWRTFqaUmq6OlW vUKiWJcssqhAcGm9I26fPjoeZ3kY4pdbtLOAODskdF04once06hDihTd4z1T8vqGBpW8 MpMDWgTj+Aucorvui51X/oBrIV7Hcr7iMxe8awNr3VKlCeXO568wbfndgcBqV+QjWGgQ za8RVEOUSOHTUAO7bJvkh6MXFXQRsFgZITEcBA/yhC9SKt8eymUcgJzXKoLdAVJWQQ/b CUTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=lyyH4SUNbL+qV4PQ4MvsIqjFPayEORBiISRr4fYofeM=; b=MVkBOQhXnkfpLQPNrS4NXjGwxi/MykZ7/H6eBtyz4VpdBiFKtiHsGnrI/fmK7I+ueH fKRCtGeq8qOO8+EEW2ojE2d3RAmYIRdlvsP5pr5mIp7bImqMQdwf8LgYOPZAD5+fjZI1 Y9RV66p0TeiE3whg5ADQQ8acwj0xzq3P/hQixJOLBXkUCQIreZQlZRKzDR8SW9j+KHwj v4cvy98f6/vR4U5P/xragmfk4x3QFCfwcdXq/0VZHQonHcXiIh/ekJxOEcXiP4evX4h5 x8jlhA/xh6IEfhrK/VQbn3KHzo+T6CN9uk/o+knIafYNP0bP4IXTP+YQ4hRS07necCky OB3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id m5si1162988pfm.149.2018.12.06.13.13.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 13:13:17 -0800 (PST) Received-SPF: pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB6LArM3022650 for ; Thu, 6 Dec 2018 16:13:16 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p79kx567q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Dec 2018 16:13:16 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Dec 2018 21:13:13 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Dec 2018 21:13:09 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB6LD8QD50987252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Dec 2018 21:13:08 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A62811C054; Thu, 6 Dec 2018 21:13:08 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79E5211C04A; Thu, 6 Dec 2018 21:13:06 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.206.110]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 6 Dec 2018 21:13:06 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 06 Dec 2018 23:13:05 +0200 From: Mike Rapoport To: Jonathan Corbet Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 1/2] slab: make kmem_cache_create{_usercopy} description proper kernel-doc Date: Thu, 6 Dec 2018 23:13:00 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544130781-13443-1-git-send-email-rppt@linux.ibm.com> References: <1544130781-13443-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18120621-0028-0000-0000-00000327259A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120621-0029-0000-0000-000023E3392F Message-Id: <1544130781-13443-2-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-06_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812060177 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Add the description for kmem_cache_create, fixup the return value paragraph and make both kmem_cache_create and add the second '*' to the comment opening. Signed-off-by: Mike Rapoport Acked-by: David Rientjes --- mm/slab_common.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 7eb8dc1..dbf63d6 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -406,8 +406,9 @@ static struct kmem_cache *create_cache(const char *name, goto out; } -/* - * kmem_cache_create_usercopy - Create a cache. +/** + * kmem_cache_create_usercopy - Create a cache with a region suitable + * for copying to userspace * @name: A string which is used in /proc/slabinfo to identify this cache. * @size: The size of objects to be created in this cache. * @align: The required alignment for the objects. @@ -416,7 +417,6 @@ static struct kmem_cache *create_cache(const char *name, * @usersize: Usercopy region size * @ctor: A constructor for the objects. * - * Returns a ptr to the cache on success, NULL on failure. * Cannot be called within a interrupt, but can be interrupted. * The @ctor is run when new pages are allocated by the cache. * @@ -425,12 +425,14 @@ static struct kmem_cache *create_cache(const char *name, * %SLAB_POISON - Poison the slab with a known test pattern (a5a5a5a5) * to catch references to uninitialised memory. * - * %SLAB_RED_ZONE - Insert `Red' zones around the allocated memory to check + * %SLAB_RED_ZONE - Insert `Red` zones around the allocated memory to check * for buffer overruns. * * %SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware * cacheline. This can be beneficial if you're counting cycles as closely * as davem. + * + * Return: a pointer to the cache on success, NULL on failure. */ struct kmem_cache * kmem_cache_create_usercopy(const char *name, @@ -514,6 +516,31 @@ kmem_cache_create_usercopy(const char *name, } EXPORT_SYMBOL(kmem_cache_create_usercopy); +/** + * kmem_cache_create - Create a cache. + * @name: A string which is used in /proc/slabinfo to identify this cache. + * @size: The size of objects to be created in this cache. + * @align: The required alignment for the objects. + * @flags: SLAB flags + * @ctor: A constructor for the objects. + * + * Cannot be called within a interrupt, but can be interrupted. + * The @ctor is run when new pages are allocated by the cache. + * + * The flags are + * + * %SLAB_POISON - Poison the slab with a known test pattern (a5a5a5a5) + * to catch references to uninitialised memory. + * + * %SLAB_RED_ZONE - Insert `Red` zones around the allocated memory to check + * for buffer overruns. + * + * %SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware + * cacheline. This can be beneficial if you're counting cycles as closely + * as davem. + * + * Return: a pointer to the cache on success, NULL on failure. + */ struct kmem_cache * kmem_cache_create(const char *name, unsigned int size, unsigned int align, slab_flags_t flags, void (*ctor)(void *))