From patchwork Fri Sep 14 09:27:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10600567 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 481B414BD for ; Fri, 14 Sep 2018 09:28:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25A372A323 for ; Fri, 14 Sep 2018 09:28:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1976D2A386; Fri, 14 Sep 2018 09:28:18 +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 BA1042A323 for ; Fri, 14 Sep 2018 09:28:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 176578E0003; Fri, 14 Sep 2018 05:28:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 102808E0001; Fri, 14 Sep 2018 05:28:15 -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 DAD888E0003; Fri, 14 Sep 2018 05:28:14 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by kanga.kvack.org (Postfix) with ESMTP id A46B78E0001 for ; Fri, 14 Sep 2018 05:28:14 -0400 (EDT) Received: by mail-ot1-f69.google.com with SMTP id h9-v6so3255005otj.10 for ; Fri, 14 Sep 2018 02:28:14 -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=g1bCG+58AFobmL9mWb5txI2dnP1AejMidsaVZJ8Tpyhz05toF0NzWkRF4J3Uri6s+a zoywLofWsHRG3wa1RMbmyRkqA3jbocLw43KZPEz4Vqb6Fjya7agEst74VuyDolCRVnAZ IWYRIiOwdgsHzS6D6ehR3/mFRSdiB9oCztoBJl6e9qcDRU3X1AR7auw85QdpGO6UQoi7 u7ejSpJiZbs+V+12uzPVpPBOxFuZkMrNyuRGzz1we5mI3GLgmtgkRIhozRCr5CXLlcFw 5QiRyLB4XOtwv6lqi0L+18unAMC1XBR1zBvqAR4KOn5L0V5g33TMUWDSt2nzDC1IzctA xBGg== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 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: APzg51DNFjcexofh46VR3qkSQ7W8ccZYtpcJ80b9zS87qmZr342ylA64 XH/cfah8l1EaWZxWg2yqWuhB6CrR9E4/g1HX4TQzs+Tm6rCQBz3v0HulZveKRHfaWXb3gA4oWl9 QA8Fo/ccw4lIUi0Csw4Gx+nYMm8/NTjBaGaWz+ZTnxYwhakCUXs9Um5Qh2JrtWRQ= X-Received: by 2002:aca:e0c2:: with SMTP id x185-v6mr9312205oig.220.1536917294448; Fri, 14 Sep 2018 02:28:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYeGuVexVZXrWigV4G0RzaKeybF46LGr8Bpn8KJfOKpQxUVTSS1vlUN1vmI97wEgTWEsY1p X-Received: by 2002:aca:e0c2:: with SMTP id x185-v6mr9312179oig.220.1536917293391; Fri, 14 Sep 2018 02:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536917293; cv=none; d=google.com; s=arc-20160816; b=eKp+ZjXlUOY97JX3a2jbk4+4Vxg6GVnMpayecHZK+OQgYyER4ndRpeUH+1/+Z0OWmP LYq6EWXzQIXU8CH8tB9hOeX7oCbnoBFnleX5m6MEhqdZyub00jgLxJ3Bxop0A7U2y27P vt+Yyq9wjfq7VfvsEKeGehY7g4EmdPy7CBWJGzUa5SwBFa5guDv+UGaRJC+bumNV+Gf0 ADAuLdxU9ictfLjSY1b5XBnLwzPCt6ccRWQAfKOOfocFT+B10IhLY/sx2KMxfSo2FH6r sKGosc0ODvEg3d6S/+EBRKz1rdF2fiLEo+8loj9A7gJEpTDRs0ZTKwKlNWqs+X1BmeN4 BLfw== 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=ZowTO1TDaS59rxKU2KGkw6pftOm8dHtDneWjaFSyl/o=; b=pvocRAcS7KPv0dbFynredUHFUFEgwKGAVh6Tr+2R07sj3cWTiGrhTs7G6SGYOHH4y1 phiCKP3PWiJyk5/XEy0k6+yvlODjdmLDpNcVsAEfoxtKNM8n9TJpedZ7RKfKgKu9saVb eKIPydt/tOQQsqKF6mREF9dAcNnsaxfcT2Umu4Huco0/pk4XFYxa9vHpWTp0Y4yXAU5A xCiYf+LUlwltW9Nx5dLAnjJ+3+zNYljtQeM8ZSToBwPDC90aDeZ/iVcYJ1TCwR/3zZ2C mx9qt7O2jEbgDmKxG3x0xBKSWD+OMeQq8/uLJpx7oaQQ+tdMwJlyoVnBn+UjJ704BRr0 sSTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 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 (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id z10-v6si1529752oti.104.2018.09.14.02.28.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 02:28:13 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 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 (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8E9OSdh107407 for ; Fri, 14 Sep 2018 05:28:12 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mg9c729nh-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Sep 2018 05:28:12 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Sep 2018 10:28:10 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) 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, 14 Sep 2018 10:28:06 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8E9S5aE43450372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Sep 2018 09:28:05 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF81D4C050; Fri, 14 Sep 2018 12:27:55 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 036AB4C044; Fri, 14 Sep 2018 12:27:54 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.207.116]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 14 Sep 2018 12:27:53 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 14 Sep 2018 12:28:02 +0300 From: Mike Rapoport To: Jonathan Corbet Cc: Matthew Wilcox , Michal Hocko , Randy Dunlap , Vlastimil Babka , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH v4 1/3] docs: core-api/gfp_mask-from-fs-io: add a label for cross-referencing Date: Fri, 14 Sep 2018 12:27:56 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536917278-31191-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1536917278-31191-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18091409-0016-0000-0000-000002055046 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091409-0017-0000-0000-0000325C2554 Message-Id: <1536917278-31191-2-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-14_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=981 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809140101 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 Sep 14 09:27:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10600569 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 27E9214BD for ; Fri, 14 Sep 2018 09:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05A0F2A323 for ; Fri, 14 Sep 2018 09:28:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDDDB2A386; Fri, 14 Sep 2018 09:28: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 9A6232A323 for ; Fri, 14 Sep 2018 09:28:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E26688E0005; Fri, 14 Sep 2018 05:28:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D0EB98E0001; Fri, 14 Sep 2018 05:28:15 -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 B60B58E0005; Fri, 14 Sep 2018 05:28:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by kanga.kvack.org (Postfix) with ESMTP id 7A5C58E0001 for ; Fri, 14 Sep 2018 05:28:15 -0400 (EDT) Received: by mail-ot1-f71.google.com with SMTP id y21-v6so3248780otk.6 for ; Fri, 14 Sep 2018 02:28:15 -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=cDrIfxsV6yWW8TGtC62y9XYFQBDieEoc03HcsUILy1xqQpXK2v7FxW4i+D5qt7QNi5 UdxG5lQCjGHJ6d4WibDJwY338U80mmdechIzM4F3GaVDtv6R0b8rVcyBD1ssIJuOvMMq k3FkWJPgt4WGXTCs6WWho/u6iHVuiU3NtlafgtoA0ZzwkpM3y92CCL65xBt/8PQ9djNR sTltAWHx0vhzoDHkzTGgSWoGNvWAGsXiWcu7T7pJHfFu7nlqUHBDVE/mp9KUuDqenZTg XOXmnooBKvgPci8c0CkPZrmvakzz4Kc1UXLwCBiV417dfrLdg+hMNuFCc3EfMAxeU2xy k/hA== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 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: APzg51CbjHK6KZ+lU/au3LslVudbLL5MRJz8US963q9XbQORNKAEJuYb 59Yc5z7McJQJX1xhqT2DSMm/iB03n0n+8iWNWsST9Y2Kt2iP9Pl9RPsAuKoKz92fyDtWtDBpHpD MxY2ZH+8AsFFYVBFC4dtZTagaMQxUH8kim6td8xw3udqtKIXjTx2InbCOiNbj3hk= X-Received: by 2002:aca:d0d7:: with SMTP id j84-v6mr9208564oiy.37.1536917295224; Fri, 14 Sep 2018 02:28:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYgOP+/JDwpeBS1nzoER0ZYJYTYrkBqvNYJP2b2pTsekNh9rDAob5utM2NMxXYwPAykNndc X-Received: by 2002:aca:d0d7:: with SMTP id j84-v6mr9208533oiy.37.1536917294416; Fri, 14 Sep 2018 02:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536917294; cv=none; d=google.com; s=arc-20160816; b=AqPPHpGQtP5EJneub4rmCIrjNMUY99r57yYH3fvLqALFu+1x1qMh66gugNr6azMUkm 8at/teKTSGFl3O+mYr31LsbzOLIzcuDIIXvsm3Olb7xwkVDpax27IhLRxOQ6Wx8gFy+0 m0IT/FRD43lnd30yLdxnbzKue5tki+ja3hfxWkIdrwhQ8yvlRcbW9J2xyGikQ+9aFdSl wZY1AspnpG6WWOs1ngErkpU2Q75SXq/1tAn19EdyTGnLLdAlsxJuYi7RxhGQyQnKQu1V pHdNXfX1kmqT+hqd2EwKkExUQQoHdprGndD+2ryq2euxJHBbjDGxSojEeUUcfvyzOJPH AFAQ== 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=7AJx07QG3hYVbJ3epDprLznYQm3Y50svF5rZrDAOVw8=; b=YSLV5tgzeRgm2yL/pAIuJMftXKY/ZaVPLfSzLrslkavKFTyGz6MvGYY3yslJ4Y/LXl DK3oQDaHinTlkVJZ6nZl5QqX3vOXyXOP3Q9tuZsglzMDkraqzrxyoDbm+E3TQvB7SV4F xn9mHRRkQZJRBAFip6dJlk3JGPW4vXjf+G87MUh3Va14U0ayS75WsR6D4U77wG/fyK91 LUxTb/1z2ORW5ildx76OE9Fh+UXBE3r6VuQtoQXshJny/uBIbzvDPzdWWijnWo03uONX HXIMWGFxl/cRbWgE1AQ+7EYLr+bcDZ3m7UeHxgJ5Biw4e30ddK9SqDqegIsYvX4Pq5fT gunw== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 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 (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id o10-v6si3614029oik.337.2018.09.14.02.28.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 02:28:14 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 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 (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8E9Os7L066037 for ; Fri, 14 Sep 2018 05:28:13 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mg7e9q496-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Sep 2018 05:28:13 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Sep 2018 10:28:11 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) 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, 14 Sep 2018 10:28:09 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8E9S8CO58130640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Sep 2018 09:28:08 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ED833A405B; Fri, 14 Sep 2018 12:27:55 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 21526A4051; Fri, 14 Sep 2018 12:27:54 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.207.116]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 14 Sep 2018 12:27:54 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 14 Sep 2018 12:28:05 +0300 From: Mike Rapoport To: Jonathan Corbet Cc: Matthew Wilcox , Michal Hocko , Randy Dunlap , Vlastimil Babka , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH v4 2/3] docs: core-api/mm-api: add a lable for GFP flags section Date: Fri, 14 Sep 2018 12:27:57 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536917278-31191-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1536917278-31191-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18091409-4275-0000-0000-000002BA4973 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091409-4276-0000-0000-000037C38626 Message-Id: <1536917278-31191-3-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-14_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=691 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809140101 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 Sep 14 09:27:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10600571 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 3A2AB14DA for ; Fri, 14 Sep 2018 09:28:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1678E2A323 for ; Fri, 14 Sep 2018 09:28:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A9012A386; Fri, 14 Sep 2018 09:28:24 +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 4B2582A323 for ; Fri, 14 Sep 2018 09:28:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DB558E0006; Fri, 14 Sep 2018 05:28:20 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 963168E0001; Fri, 14 Sep 2018 05:28:20 -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 7938C8E0006; Fri, 14 Sep 2018 05:28:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by kanga.kvack.org (Postfix) with ESMTP id 4ADE28E0001 for ; Fri, 14 Sep 2018 05:28:20 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id j5-v6so8951571oiw.13 for ; Fri, 14 Sep 2018 02:28:20 -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=ugJDscXhygT/RbyheeqpnxJKJh99AkSxv4jKqIwo7XA=; b=FO/25KFPQCREelKEptMQW0VaFxZc3LnkZO3Qm/U6Rz56Fnz7nUFuddVAfGvTv4Oht5 SdgsFiQnJklLRvLtmSiyK4B7mLm1LVO3jOTU6PxtqpfHgS5WUuuy/X+fuMLj5zpJfqv6 VQg1Ym0jqVWyXJPblxhzAgldALqiEkf5fbQ4VRWqB0wU3yRSDmX+HxArl1YDuGb1ClsN 5EOWi9u8/PZSi651VKyVGkreXUxz7I3e9QDASAjYDY1ZRZhs5ER2U4Z7EqQAzASmonYC J0RjgCAppjg96mgjbBhy04ONBxLc36LzxtKU4LpEFvNKd9cI+cxDKjq3+vBDqlL2KLht FLEQ== 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: APzg51DgVFZA+XQP8uGS4IHdPFfDWJ94a6RiQI3o+I4vPy2t9WDP0cIG mQTJfmo3mM5pVG19/Ms9EJfsFR1d11Bj1Ck2LrBp8qXE834V0wF+ElQz8C//yocdKEr7sGGbX6B x88HB4D/InRmLvtSC1mV9Ym+v2z77OXz6YdbZTAaQqxOMTMF9RFz4fXsoJXMTwAw= X-Received: by 2002:a9d:628:: with SMTP id 37-v6mr3939214otn.285.1536917300019; Fri, 14 Sep 2018 02:28:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbzDVdc2nWlyo4PDdWsv+pEkKAbUdVKHaiHqr9jA3n8MI3aq4tbv36WfIJVGTGIukEaN7rz X-Received: by 2002:a9d:628:: with SMTP id 37-v6mr3939168otn.285.1536917298773; Fri, 14 Sep 2018 02:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536917298; cv=none; d=google.com; s=arc-20160816; b=rDawJ/Mf4CycEvvEjRuiJ9TQkZRiYVLr5+aulsdvZqIPq8tKoQ3U9CYixV7mtIhTGU HZJhBd8pZYARtBG9wMjAfTUfEaVnQEMPKrhFRVEOo3rj1rEYRSV4zndeKHzN62kPBRLf ESk/P8FBPTB2HZmhzIFmBDV1SmNWupB90S+seJau0Wq4x2if30qhdqQtfW80SIigzwXX AYFGHYfpH5KM72LLVG6kgV4Wj1lSiWTUqgl7HIAD1ufBYo0HiJUWjNuqiXgkRVR1WGaX JA6rzUO3rFb0Cdf15j5x37DBhbB7yucGICc9voYnGZ29+B1GYYrzjd4L82PePBOITaKO /XdA== 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=ugJDscXhygT/RbyheeqpnxJKJh99AkSxv4jKqIwo7XA=; b=HFCIubaruuxbSuIEyJRbwOYtkodUIOQu3IH1/zSbbiIvddR/srlUZQIwH3hOhXx8PM wOBV6TrnSHIdqxyk1eBrE3bjaug/av+lzdPX5jSsbDXBJaZBPyTkfgDuOmxuuLQ993VO kor6n0cBKuKS7ls+wPLrPx2d7vnEX5kQgt/7sldyTLDf8gzU93ixozpphP6noW46egUU 9UiNmYILkiLx49GHQukJGefCot1VM4it7u5/tFlZTFu4HPF/7kB3fVSv9uehvkFxY/t7 QBtGnjBKHOGZDAjkl1lRyK5PuQEtdoNwazF8PAOxJfDMsB5uL2PYzgGCbihdDME7qcYe UOvg== 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 o125-v6si3519835oib.242.2018.09.14.02.28.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 02:28:18 -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 w8E9O41I125547 for ; Fri, 14 Sep 2018 05:28:17 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mg8y9uy34-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Sep 2018 05:28:17 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Sep 2018 10:28:14 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) 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, 14 Sep 2018 10:28:11 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8E9SA2x58917038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Sep 2018 09:28:11 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04DED4203F; Fri, 14 Sep 2018 12:28:01 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C4A542049; Fri, 14 Sep 2018 12:27:59 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.207.116]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 14 Sep 2018 12:27:59 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 14 Sep 2018 12:28:08 +0300 From: Mike Rapoport To: Jonathan Corbet Cc: Matthew Wilcox , Michal Hocko , Randy Dunlap , Vlastimil Babka , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH v4 3/3] docs: core-api: add memory allocation guide Date: Fri, 14 Sep 2018 12:27:58 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536917278-31191-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1536917278-31191-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18091409-0012-0000-0000-000002A8C425 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091409-0013-0000-0000-000020DD0E2D Message-Id: <1536917278-31191-4-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-14_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-1809140101 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 | 122 +++++++++++++++++++++++++++ 2 files changed, 123 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 26b735c..165d7688 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..f8bb9aa --- /dev/null +++ b/Documentation/core-api/memory-allocation.rst @@ -0,0 +1,122 @@ +======================= +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 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. 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. + +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`.