From patchwork Fri Aug 17 14:47:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10568965 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 F3E6F14BD for ; Fri, 17 Aug 2018 14:47:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E585E2BBF3 for ; Fri, 17 Aug 2018 14:47:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D82E52BC0C; Fri, 17 Aug 2018 14:47:35 +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 7F3052BBF3 for ; Fri, 17 Aug 2018 14:47:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DADB6B08BA; Fri, 17 Aug 2018 10:47:34 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 78A0A6B08BB; Fri, 17 Aug 2018 10:47:34 -0400 (EDT) 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 6515F6B08BC; Fri, 17 Aug 2018 10:47:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by kanga.kvack.org (Postfix) with ESMTP id 39E7F6B08BA for ; Fri, 17 Aug 2018 10:47:34 -0400 (EDT) Received: by mail-oi0-f70.google.com with SMTP id 20-v6so7272062ois.21 for ; Fri, 17 Aug 2018 07:47:34 -0700 (PDT) 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=ZowTO1TDaS59rxKU2KGkw6pftOm8dHtDneWjaFSyl/o=; b=HqverEA25smmlz6aFDv1+ddJdUM25tH00TQWrDgIS7IxkS0FES6oXuW9ML4GBzRm19 MnY0mHYZLE/W0HbBmldRqud2RW8TsVS24YmeZWtyJVLnu/QaI2J82ltJ7CwlCupeewTl QxLcGlbddnEE/LIHyRJuNDHv5jUCvAoIvX3rK3qe/jzSUpbOb6ZOCaa8fQlui+fkmhFa s0ZD8XbzMRm0zmSa4zNf8WU7B0DKB9HvBcxUOLyAbe2E0ipRWNia54rj4uM1npw0Glqb 1fgGXKkCCod+7d0XYn5PWJqbb+obIwXoT6KnYuoYpSUESSAysCmQEToW43zS7UBpH9ow 4M9w== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AOUpUlFUen7rehW+IJZz/QZO5ohQy9r7zrCLZJ/CXfl97c5inpuGhxlr 1NNaVC3Jc8WxRe+Fa4h6zB+gvWC9J19+FNwNMrxsevyYsylTkNbk5GIt1CYUQQN46BVYIUmtqSJ cdxpDxDJ/d1qcyDhhdO9JTbmH4bIYvEESNa7IjjT1RrAICHGpxoyCr0hTE/L5sq8= X-Received: by 2002:aca:2c3:: with SMTP id 186-v6mr2948206oic.85.1534517253980; Fri, 17 Aug 2018 07:47:33 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxt2Sg32n9ESoE8wVlXeNFKoToK8Vf0B2VPun+mu64xOypLYLpVpfbX4j0oXhDj55Ty2CZi X-Received: by 2002:aca:2c3:: with SMTP id 186-v6mr2948153oic.85.1534517253332; Fri, 17 Aug 2018 07:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534517253; cv=none; d=google.com; s=arc-20160816; b=tEM41iFuy25ZBj8a7KvCShR+w2FnR8avwxVhI2/KxGHXN7bmSBTg+xVCdjGodycAaJ HnTDR920xpw3zBr4Zd+2OFFUW99DsX1+Xf7VQiED9OjL3J57iJR0W3G6RkKcHnykEUzF C2j/9/+o6Pkxrh6b5+q5ptBN0qkuPgQG90beU3CnoWSiLJg9Ia7jal71PUi9XSzGW/zH c40RW8Sgo2LoYlCW4h+OI5PzmtqWemfEO9U6h5G71O92EPqnOM2aagRAIILuAv2Gy1Pr l4wsnB9J0205zwmBmnZROg5R47Wd9jZk9I/FjW3orcSwOqwmgQ7b3K3sZaurpJnffyyr GkPg== 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 :arc-authentication-results; bh=ZowTO1TDaS59rxKU2KGkw6pftOm8dHtDneWjaFSyl/o=; b=V0ArLzkpYyRSwFiZf+ivKHKNWpeH/TtbKJsvFzHaR5tOEMfk+EWcIEl4BS0mMkBM5h sdIlOskEYOROlUrY14+Tucj/ytUpWHgX7wHuh8CEiyJwgj45hvybAoABzHSDxgLgvVZX Ay7Qg9zvrfBbKGl1ZeRUgeuJsRpJ0q1jeVxQkFgJU7CSVNCMCGbD3yb8Ec+L6dVBB1DE wAKpRn5AEYVtxBYdj1TAJ3qO1AiGtXBM91sii899qK/VP3dgMeS3CtoQtted7CJnwvVa Umo0BU21cwXmaNaciNff2i0mvbRRd8oqdNhscL+TPDqf0NmBK9jfdRFu5WZwKxAw+p6P AAUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (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 w63-v6si1603044oia.18.2018.08.17.07.47.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 07:47:33 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7HEi9Mi036928 for ; Fri, 17 Aug 2018 10:47:32 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kwwjkqfvb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Aug 2018 10:47:32 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Aug 2018 15:47:29 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 17 Aug 2018 15:47:26 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7HElPxq37093424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Aug 2018 14:47:25 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D007A11C052; Fri, 17 Aug 2018 17:47:27 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF37A11C04A; Fri, 17 Aug 2018 17:47:25 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.205.113]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 17 Aug 2018 17:47:25 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 17 Aug 2018 17:47:22 +0300 From: Mike Rapoport To: Jonathan Corbet Cc: Michal Hocko , Randy Dunlap , Matthew Wilcox , Vlastimil Babka , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH v3 1/3] docs: core-api/gfp_mask-from-fs-io: add a label for cross-referencing Date: Fri, 17 Aug 2018 17:47:14 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534517236-16762-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1534517236-16762-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18081714-0012-0000-0000-0000029B3593 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081714-0013-0000-0000-000020CE663F Message-Id: <1534517236-16762-2-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-17_04:,, 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=990 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808170160 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 Signed-off-by: Mike Rapoport --- Documentation/core-api/gfp_mask-from-fs-io.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/core-api/gfp_mask-from-fs-io.rst b/Documentation/core-api/gfp_mask-from-fs-io.rst index e0df8f4..e7c32a8 100644 --- a/Documentation/core-api/gfp_mask-from-fs-io.rst +++ b/Documentation/core-api/gfp_mask-from-fs-io.rst @@ -1,3 +1,5 @@ +.. _gfp_mask_from_fs_io: + ================================= GFP masks used from FS/IO context ================================= From patchwork Fri Aug 17 14:47:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10568969 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 0BA5014BD for ; Fri, 17 Aug 2018 14:47:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3C032BC05 for ; Fri, 17 Aug 2018 14:47:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7E4F2BC06; Fri, 17 Aug 2018 14:47:39 +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 844CA2BC0E for ; Fri, 17 Aug 2018 14:47:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62DF46B08BC; Fri, 17 Aug 2018 10:47:38 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5DBE86B08BD; Fri, 17 Aug 2018 10:47:38 -0400 (EDT) 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 4A3906B08BE; Fri, 17 Aug 2018 10:47:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by kanga.kvack.org (Postfix) with ESMTP id 1E1006B08BC for ; Fri, 17 Aug 2018 10:47:38 -0400 (EDT) Received: by mail-oi0-f72.google.com with SMTP id s68-v6so7217919oih.23 for ; Fri, 17 Aug 2018 07:47:38 -0700 (PDT) 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=7AJx07QG3hYVbJ3epDprLznYQm3Y50svF5rZrDAOVw8=; b=uRqHnHZEjgzE9GmeC9uIy1gfb5Oh+TN++Ayp5tLWaQziFwkl14eNu3kVgpoApHH+gB Y7DsPzfZjgm3BasPadpLR/eqlOMdnnvVnzz6udpLjkA8xklqjbOZiVSNHSwTG+fWZJHx fSudc3suAVGcQofLRZN/bVmFQ98JWjW+3uEP+8knLcKEzFctJX0NNdF7I2fbI2ZljxQ/ GGTJfVK3Ef0jcK1nLt9td0O1ZSTwwHcpsmntLFZAKVpKbZ6IMdxEe2H7Sc8vuFXMJJLO fL5j+sZFXUMahsjBvCCyul1dbkijj5sm4yg6tcJCNqaVtHULRTCTmb3v60Fm5GfHSIfr kvog== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AOUpUlFA3wplN++EiMU0GDGlQCU9a/2Qec35RtZWxhrs0ggz3Fe6bMvP GJuvivd+B4jD4otINKW761IrO7SpUd1mQfAUo4ErSPZ1tNqemmfSQPgCk4dswmLDmmLCJB31PHi QKQ9jNwtvUjWV5FUKaxO3LrcCCEiSXPFxGy1cABoC8bA33ojUb3wDHxDLKiyPNHQ= X-Received: by 2002:aca:2c89:: with SMTP id s131-v6mr2918182ois.171.1534517257784; Fri, 17 Aug 2018 07:47:37 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxG2vuGGy2R9GZuC7fuEeZbXxBSzrkZYpGt3EW6VPQoCyZrybC0FIWhmsxzBnKIN2dAiTGU X-Received: by 2002:aca:2c89:: with SMTP id s131-v6mr2918129ois.171.1534517257091; Fri, 17 Aug 2018 07:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534517257; cv=none; d=google.com; s=arc-20160816; b=hWpAMmkofP1fuPZ0OQD8kH1BF9lsr+K3cbp4E/kKyr7htTSFWPZkMdKH2CfAY+9c9E 5bNuP3xssG2vebWzOqh+a68gfcvn8abjSeKmnPhoz9mP/1dfWMU1zAaojQ7fWC1SRiYu VMBBIlY/RMCUrUi/M+Np6/rF91M1+m44lYrMoPbOjzjXfo1CGD01rDrbYGX7+HzUfwhv UW/DOdCvD03rqEdX+2qjEBdA9fsGwKyL9A0F4eaMXBKxdtUqTvfzob+oNcQ3f7d1/ff/ cZO2NQMQV6+Fg4DJa+lu/RqGK1ouPAm/DJ2JSXlYcKayCnV1xtaYAMDtpOozO4RniK3L LFIw== 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 :arc-authentication-results; bh=7AJx07QG3hYVbJ3epDprLznYQm3Y50svF5rZrDAOVw8=; b=vy7qsC7tKJLqdXU5HmBH45rVCKcqb+NBzxU2U7L0RlyLJCB/Yr0XG1SkRNJZlYVKsW 5PVCNtqHqZCvzk4osUBIcT5cWIOEutJGFN0sXjoAVGg9/LregLQKzyFUb/mA6tGM3kgX v4I9LIbTYGuOwbkrNN5iDij6VZLUsOs7KxanTOkmh7hPkkSu2ps5vHSz5S02hfX+uawH YU8FxhMP/NQbLu2k3PC7+1o0rLe6HWgoBCtcn1bjG447rLQKJWabAM9a9r3bERp7nEpT jww/HvvjPi/TnMDMvSKqqbrMgzCgFGUE8h7Sh6Y//4eXAxqGBBcLyovp7rZGsBVxXjXA Dzng== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (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 r17-v6si1346936oic.35.2018.08.17.07.47.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 07:47:37 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7HEi7Gp067751 for ; Fri, 17 Aug 2018 10:47:36 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kwyun1gxc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Aug 2018 10:47:35 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Aug 2018 15:47:32 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 17 Aug 2018 15:47:29 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7HElSbQ37748882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Aug 2018 14:47:28 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBF47AE04D; Fri, 17 Aug 2018 17:47:11 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD426AE051; Fri, 17 Aug 2018 17:47:09 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.205.113]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 17 Aug 2018 17:47:09 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 17 Aug 2018 17:47:25 +0300 From: Mike Rapoport To: Jonathan Corbet Cc: Michal Hocko , Randy Dunlap , Matthew Wilcox , Vlastimil Babka , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH v3 2/3] docs: core-api/mm-api: add a lable for GFP flags section Date: Fri, 17 Aug 2018 17:47:15 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534517236-16762-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1534517236-16762-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18081714-0016-0000-0000-000001F83AC9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081714-0017-0000-0000-0000324E7802 Message-Id: <1534517236-16762-3-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-17_04:,, 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=709 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808170160 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 Signed-off-by: Mike Rapoport --- Documentation/core-api/mm-api.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst index 46ae353..5ce1ec1 100644 --- a/Documentation/core-api/mm-api.rst +++ b/Documentation/core-api/mm-api.rst @@ -14,6 +14,8 @@ User Space Memory Access .. kernel-doc:: mm/util.c :functions: get_user_pages_fast +.. _mm-api-gfp-flags: + Memory Allocation Controls ========================== From patchwork Fri Aug 17 14:47:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10568971 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 1B38C14BD for ; Fri, 17 Aug 2018 14:47:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BF162BBF3 for ; Fri, 17 Aug 2018 14:47:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 004B62BC0C; Fri, 17 Aug 2018 14:47:44 +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 3DA9F2BBF3 for ; Fri, 17 Aug 2018 14:47:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1976A6B08BE; Fri, 17 Aug 2018 10:47:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 123B16B08BF; Fri, 17 Aug 2018 10:47:43 -0400 (EDT) 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 00F0D6B08C0; Fri, 17 Aug 2018 10:47:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by kanga.kvack.org (Postfix) with ESMTP id BE72F6B08BF for ; Fri, 17 Aug 2018 10:47:42 -0400 (EDT) Received: by mail-oi0-f70.google.com with SMTP id u11-v6so7227516oif.22 for ; Fri, 17 Aug 2018 07:47:42 -0700 (PDT) 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=1nvKbnYy9V9R/8wICRdxrgN6fFE7TekHTLwTuMTYLPo=; b=ErhPuvIPLXGyrR3jhYsq2RlAfcsfgIQYIEjlhYZPVSP22VGB5MBBTpMkDJxO/liyWl 67/gCza/yWs9Rq7boWoXb98amy1Kkhq4auNF6cqugwDmuC7EIBMMgvKpg5MSf89Vzl0h ian7Qs85fwBHqvQ9SfkVYdQyuKfYcEAvHvMfSCkSd29O6gictq6eDEZQXmsV51dvCCj9 TGHWqtoJ8QAebZAr6dRuFfEElWaXP3P4Ax0ghqVjuv6PewEaAsmvTWGxKrZbHX8hb2TJ hJOflXpPpcgzke5SiNiyObMb+r7PHuQJ8V3GRAqlmRQzmtVluzT6Ef/etwUK7MxUo5WY PY5g== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AOUpUlF1pfBz0s9GDx5V2dTq210nM0lSOvFvpKsIrGv7X6RQBDFUMfkf bwuY3LqFoUjn7jLSxwBrvCeKKf5nk1GHWXCyS8uBaBMyIiGWQaiL3pUM6bmDQG7f6kxTbE90MDk XsKn0+J7BGDWrhHmLFWXSkwj7uReVv9owJINGOtzI6MuAfI8veblkp5IG6cs5Qn4= X-Received: by 2002:aca:56d7:: with SMTP id k206-v6mr3014988oib.106.1534517262502; Fri, 17 Aug 2018 07:47:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxMKDq2BvAZvnDf/q9ebfbt2uU2LZyC4bMejwBv3kEBD9tYBkJCEcYOdFjSC/kCGi9K3j+0 X-Received: by 2002:aca:56d7:: with SMTP id k206-v6mr3014905oib.106.1534517261356; Fri, 17 Aug 2018 07:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534517261; cv=none; d=google.com; s=arc-20160816; b=IgnRL1vI2csGH3jZVlQvXqsxjVs3omJSkMcjUaHMHW+rtVs5N3v8sT6Mc+WxvRsUUv o5F3qzc3v8+/NE7UF7QjSBRtFw4P0Wt5uL8yfuOjjwi8Vfam8+0AMaeVzmI9pTKsh8Y+ Z9Wduq/yW9UpFl1ijyutBOl/zEbTZGMD5zSOQHVPPcUsohi94pOXlQgxnU6WMelRXY7E w4M1QnXswVYzXh2E0LFN5SKujpZSetbm7ImYBEudFbchC50qJ8XKbAh68yhNvS2rZb1V J4rqrr8nIEYn/nuWNSNGXjYY6OhI2MrVWMM1WGSbLKeZNFcAzkzI8roCc0kCqnpODyPi RLSw== 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 :arc-authentication-results; bh=1nvKbnYy9V9R/8wICRdxrgN6fFE7TekHTLwTuMTYLPo=; b=kJFvRZ7Crx7p77BRBxMYXjPrEkR9NzfD2Fh4xHsqLN2nBubqge0rJkyr4ftm3fBPlj Oc4ZE8qE/6HxWG4hjvLksHdAjR9C7mxz2EWnAeRCbYZz3TWR8iNFQVIrnAPph7FzYqpK r/VdzYYuM6i9Gbp8/+RjdS3WkpEIMkxFWQDmlHR8wbKIrv4FEQn9HwsxhvoioXnUBHYI xQVzzkcIkx2ctFpGXprh8VtPv2YxNYnOCRuntlLceFSnaZv+hPg/KD4Gg1vgthyhq0wH fcpMoF8tXFGhdegiIzJgpM6e6KlEuf9EQp4IvsXUNfNSeY/ducoRb/4I+KkcB/413twR XKrw== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (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 b125-v6si1518618oia.69.2018.08.17.07.47.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 07:47:41 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (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 w7HEiB2w091028 for ; Fri, 17 Aug 2018 10:47:40 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kwyw519wg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Aug 2018 10:47:40 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Aug 2018 15:47:35 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 17 Aug 2018 15:47:32 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7HElVwq34734260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Aug 2018 14:47:31 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 08C3752051; Fri, 17 Aug 2018 17:47:34 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.205.113]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id F3DF65204E; Fri, 17 Aug 2018 17:47:31 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 17 Aug 2018 17:47:28 +0300 From: Mike Rapoport To: Jonathan Corbet Cc: Michal Hocko , Randy Dunlap , Matthew Wilcox , Vlastimil Babka , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH v3 3/3] docs: core-api: add memory allocation guide Date: Fri, 17 Aug 2018 17:47:16 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534517236-16762-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1534517236-16762-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18081714-4275-0000-0000-000002AB3F51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081714-4276-0000-0000-000037B469A6 Message-Id: <1534517236-16762-4-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-17_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 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-1807170000 definitions=main-1808170160 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 Signed-off-by: Mike Rapoport Acked-by: Michal Hocko Acked-by: Randy Dunlap --- Documentation/core-api/index.rst | 1 + Documentation/core-api/memory-allocation.rst | 124 +++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 Documentation/core-api/memory-allocation.rst diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst index cdc2020..8afc0da 100644 --- a/Documentation/core-api/index.rst +++ b/Documentation/core-api/index.rst @@ -27,6 +27,7 @@ Core utilities errseq printk-formats circular-buffers + memory-allocation mm-api gfp_mask-from-fs-io timekeeping diff --git a/Documentation/core-api/memory-allocation.rst b/Documentation/core-api/memory-allocation.rst new file mode 100644 index 0000000..3c56543 --- /dev/null +++ b/Documentation/core-api/memory-allocation.rst @@ -0,0 +1,124 @@ +======================= +Memory Allocation Guide +======================= + +Linux provides a variety of APIs for memory allocation. You can +allocate small chunks using `kmalloc` or `kmem_cache_alloc` families, +large virtually contiguous areas using `vmalloc` and its derivatives, +or you can directly request pages from the page allocator with +`alloc_pages`. It is also possible to use more specialized allocators, +for instance `cma_alloc` or `zs_malloc`. + +Most of the memory allocation APIs use GFP flags to express how that +memory should be allocated. The GFP acronym stands for "get free +pages", the underlying memory allocation function. + +Diversity of the allocation APIs combined with the numerous GFP flags +makes the question "How should I allocate memory?" not that easy to +answer, although very likely you should use + +:: + + kzalloc(, GFP_KERNEL); + +Of course there are cases when other allocation APIs and different GFP +flags must be used. + +Get Free Page flags +=================== + +The GFP flags control the allocators behavior. They tell what memory +zones can be used, how hard the allocator should try to find free +memory, whether the memory can be accessed by the userspace etc. The +:ref:`Documentation/core-api/mm-api.rst ` provides +reference documentation for the GFP flags and their combinations and +here we briefly outline their recommended usage: + + * Most of the time ``GFP_KERNEL`` is what you need. Memory for the + kernel data structures, DMAable memory, inode cache, all these and + many other allocations types can use ``GFP_KERNEL``. Note, that + using ``GFP_KERNEL`` implies ``GFP_RECLAIM``, which means that + direct reclaim may be triggered under memory pressure; the calling + context must be allowed to sleep. + * If the allocation is performed from an atomic context, e.g interrupt + handler, use ``GFP_NOWAIT``. This flag prevents direct reclaim and + IO or filesystem operations. Consequently, under memory pressure + ``GFP_NOWAIT`` allocation is likely to fail. Allocations which + have a reasonable fallback should be using ``GFP_NOWARN``. + * If you think that accessing memory reserves is justified and the kernel + will be stressed unless allocation succeeds, you may use ``GFP_ATOMIC``. + * Untrusted allocations triggered from userspace should be a subject + of kmem accounting and must have ``__GFP_ACCOUNT`` bit set. There + is the handy ``GFP_KERNEL_ACCOUNT`` shortcut for ``GFP_KERNEL`` + allocations that should be accounted. + * Userspace allocations should use either of the ``GFP_USER``, + ``GFP_HIGHUSER`` or ``GFP_HIGHUSER_MOVABLE`` flags. The longer + the flag name the less restrictive it is. + + ``GFP_HIGHUSER_MOVABLE`` does not require that allocated memory + will be directly accessible by the kernel or the hardware and + implies that the data is movable. + + ``GFP_HIGHUSER`` means that the allocated memory is not movable, + but it is not required to be directly accessible by the kernel or + the hardware. An example may be a hardware allocation that maps + data directly into userspace but has no addressing limitations. + + ``GFP_USER`` means that the allocated memory is not movable and it + must be directly accessible by the kernel or the hardware. It is + typically used by hardware for buffers that are mapped to + userspace (e.g. graphics) that hardware still must DMA to. + +You may notice that quite a few allocations in the existing code +specify ``GFP_NOIO`` or ``GFP_NOFS``. Historically, they were used to +prevent recursion deadlocks caused by direct memory reclaim calling +back into the FS or IO paths and blocking on already held +resources. Since 4.12 the preferred way to address this issue is to +use new scope APIs described in +:ref:`Documentation/core-api/gfp_mask-from-fs-io.rst `. + +Other legacy GFP flags are ``GFP_DMA`` and ``GFP_DMA32``. They are +used to ensure that the allocated memory is accessible by hardware +with limited addressing capabilities. So unless you are writing a +driver for a device with such restrictions, avoid using these flags. +And even with hardware with restrictions it is preferable to use +`dma_alloc*` APIs. + +Selecting memory allocator +========================== + +The most straightforward way to allocate memory is to use a function +from the :c:func:`kmalloc` family. And, to be on the safe size it's +best to use routines that set memory to zero, like +:c:func:`kzalloc`. If you need to allocate memory for an array, there +are :c:func:`kmalloc_array` and :c:func:`kcalloc` helpers. + +The maximal size of a chunk that can be allocated with `kmalloc` is +limited. The actual limit depends on the hardware and the kernel +configuration, but it is a good practice to use `kmalloc` for objects +smaller than page size. + +For large allocations you can use :c:func:`vmalloc` and +:c:func:`vzalloc`, or directly request pages from the page +allocator. The memory allocated by `vmalloc` and related functions is +not physically contiguous. + +If you are not sure whether the allocation size is too large for +`kmalloc`, it is possible to use :c:func:`kvmalloc` and its +derivatives. It will try to allocate memory with `kmalloc` and if the +allocation fails it will be retried with `vmalloc`. There are +restrictions on which GFP flags can be used with `kvmalloc`; please +see :c:func:`kvmalloc_node` reference documentation. Note that +`kvmalloc` may return memory that is not physically contiguous. + +If you need to allocate many identical objects you can use the slab +cache allocator. The cache should be set up with +:c:func:`kmem_cache_create` before it can be used. Afterwards +:c:func:`kmem_cache_alloc` and its convenience wrappers can allocate +memory from that cache. + +When the allocated memory is no longer needed it must be freed. You +can use :c:func:`kvfree` for the memory allocated with `kmalloc`, +`vmalloc` and `kvmalloc`. The slab caches should be freed with +:c:func:`kmem_cache_free`. And don't forget to destroy the cache with +:c:func:`kmem_cache_destroy`.