Message ID | 20220202024137.2516438-4-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E8DC433EF for <linux-mm@archiver.kernel.org>; Wed, 2 Feb 2022 02:42:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16BD58D0094; Tue, 1 Feb 2022 21:42:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E73358D00A6; Tue, 1 Feb 2022 21:42:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFFDA8D00A3; Tue, 1 Feb 2022 21:42:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B3A4A8D0094 for <linux-mm@kvack.org>; Tue, 1 Feb 2022 21:42:01 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5E7E31826990B for <linux-mm@kvack.org>; Wed, 2 Feb 2022 02:42:01 +0000 (UTC) X-FDA: 79096290042.04.35FDE82 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 87F97180006 for <linux-mm@kvack.org>; Wed, 2 Feb 2022 02:42:00 +0000 (UTC) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2120687s022144; Wed, 2 Feb 2022 02:41:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=sqe8IuvA7gq6O4pyFA/597HFCPbJXLgXKUqrcPe7IR0=; b=YwpzXNNqr3Kz7E6jzqvRr0kqEYMfskivaSzDClK9UQMjPAWFzRhAx8tDnYzOWS6s4zzY lflBv3/QjSBH6rQH1ocM2KvYcC5uwYpHfuUbgNJhIqgEWafwLWBO0ssA1y73EC6UAHNz Nm726XGaN84CnNEeiO+OJhsKd4KdNDnEUa5gH5r45qq+mlt7nhaTCuaLU65KD21TuBoZ uAYPjwiUyvbXhcmRDmGhdlTxYey86sfHkypnQqV6OKCkeU05nrNWmEp3ibH1f9gKpnpC IDpMVrILGZDp2JufD2AmckdApteVadgn/DC/2/kCeYfexXcn4saRjnRrqR5MDVgvA/qO Rg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dxnk2m7pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Feb 2022 02:41:58 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 2122ZPED146731; Wed, 2 Feb 2022 02:41:57 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2046.outbound.protection.outlook.com [104.47.73.46]) by aserp3020.oracle.com with ESMTP id 3dvwd78vk5-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Feb 2022 02:41:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUzsos5NR52luWTtQlerTJ6RDEc2Mg+eFz7hZPEErqHmqneqC3TtEzws4L4jgGbr1Btn9x5yKmD3gwpH1XFlV2Xtm+YbYDJ9FGoubHYVvNj9GEzHs1dWN6E84QDEjrWTHIofInJHtlMQXvu0r4QQ6E4jITe+vrt4OIAnfZmEu1vtXODZZjY6MbAlztP59uudaochmYELoQ6C5Jf2Iq1F2tF2nItPitcPPTh0wsocbHJOytZzjDb1AtTmYTF0QjFfeM1yOhAIDGUYy7KbtHP4M4mhEfdJidcy74Opx01ZMhhMUrrOk/WrI96J1IulJQNzz0QxS2i3ZVGPbS+o6G18zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sqe8IuvA7gq6O4pyFA/597HFCPbJXLgXKUqrcPe7IR0=; b=VnvLO5UeP4tA8D3y+jnEIc1TuTFOM53tLqAaxdLTpY18zgzLQhsvuVf9T8wQfuqrLbGm39pbSElERYq1AqwSlJqtThlsNOM9YEFkVDVUQEzzfLW1H/B3ADtQbEk8SqF7SGH7qXGC5uF8S1DTf16aizSKBTVdO0TMTJ7EqMacFgFrsxPaQmTbn2uhbnCsBRQjgmXY5VATBXsPoK+Y6c+9fto1+TcyXFW54ib1u9k4Wn8FydhOoAxaHH/tJ/e1qfYffgWSa+03oA+3LMizUlonrJdGeGrxcQLU1pS1CwDayDYecix8aL37YckNo4m3MBQYWri1dAb90pdIyywCu6ixQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sqe8IuvA7gq6O4pyFA/597HFCPbJXLgXKUqrcPe7IR0=; b=DbMLWoJzVyB+NqJXFyeXttbH7GYTwxtX4CEQbjedo0IO3p0SxgP60Ie4I+EvZUjVvFsL5BJlTFAv2pFF6TSXbMBPzGnTGoU1TtA7fvCn7FcpJT9DNKhEdTaP9qewzccjEz8o1orjs2wmasYzuyyYodj+5d4hUdMTzWnKiFOulGs= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by MWHPR10MB1325.namprd10.prod.outlook.com (2603:10b6:300:1e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Wed, 2 Feb 2022 02:41:54 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::3857:3a25:3444:fdd3]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::3857:3a25:3444:fdd3%5]) with mapi id 15.20.4930.022; Wed, 2 Feb 2022 02:41:54 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v5 03/70] radix tree test suite: Add kmem_cache_set_non_kernel() Thread-Topic: [PATCH v5 03/70] radix tree test suite: Add kmem_cache_set_non_kernel() Thread-Index: AQHYF95wFkWnwXaFrUGUKi2o+PA9QA== Date: Wed, 2 Feb 2022 02:41:54 +0000 Message-ID: <20220202024137.2516438-4-Liam.Howlett@oracle.com> References: <20220202024137.2516438-1-Liam.Howlett@oracle.com> In-Reply-To: <20220202024137.2516438-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.34.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 94689b5b-1c16-4afc-0290-08d9e5f59324 x-ms-traffictypediagnostic: MWHPR10MB1325:EE_ x-microsoft-antispam-prvs: <MWHPR10MB13254EE5179D32BB24240860FD279@MWHPR10MB1325.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 90NtkHvH44Zv1ujoOXTVB0rHXNFEMCtGxwSd+uSuTDYXQEg4+7y49WxBnGRgenZFkPuhw6aLVVN0mCt0uKd5WORuEbaOvKBNWdrT9CyPm0XDEyUtPExeTt1ZqDyeVdIXj/Z5vBwQALLHVyxTnfOUxNEhsFGkoFeHWTFcRos5g0uhFklAI5lPjfZcqnSsh+DfZN18254uoeYpoDUzJSggrf38DtCVzj9RTsnz9mJgq+Ke7sju0f+RlwaRthyLP1Zc/eT7VNtpkQf3w/w4Mmr8b/ws0PHvMBM4PzKATAxk10g4hpAXC1Cc+EfrfwyXTgVgorkQuuoxDXdaPtjI7Ri7z/DjaW6eyobphVjaTSu8/klJK+AxwRugkIOe4qYFSLwd9PHQ8Y2nUyH+HxIhlmIPr6FiDM/yj5qf0QzF3x7SpqxExFN0m4sslw/Ub5LRsXx2jBr4jikNbdO0ZL8y34wlLMH+CRuuI6D0zhe8zQNsln4DLDTrDsZ2rF9sDVSG7Lgoyo0MO9I0J8nKU663rIIU0Ud8oo3J/ZbFg3vnMyjL4H1TXlGfjdYu6ZHTJ1ApqxoG5GvA2tyF+X97zlokUKA91KNxpx27Ua1lWmZM8t9XBMcDDPivrHEDh2/z2sSeeCYlo81bH6I2KN5ivWW/ger01jldWTdSqUdJgiJw0ZTBL/aXA7CMkAFsV5u/5SaOSqXj x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(83380400001)(5660300002)(38100700002)(110136005)(86362001)(508600001)(6486002)(6506007)(44832011)(91956017)(66946007)(26005)(38070700005)(2906002)(122000001)(71200400001)(66556008)(186003)(66476007)(66446008)(64756008)(1076003)(8936002)(76116006)(36756003)(316002)(2616005)(8676002)(6512007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?R+zJwH+Q5Kw9+u5aX7b4LId?= =?iso-8859-1?q?hPCDuuTC9vJgLk2VjxezgQq6fSciv43AqjFrNJU+HpKQZ/+u6oWbOfhNFizp?= =?iso-8859-1?q?A85KorFgRFjqr/0YCssV0QYcozn2dZUSQhp2P1v2cqUt1Em9aq3v5kqSdN82?= =?iso-8859-1?q?oevjwRKFyvk78bQTDBWJcIr3ionT8pkwitVqZi6jHt+Of1IAxwSqxFZa97mO?= =?iso-8859-1?q?PFruNYJOwR/u4LPOYC9lGMACHg/UegJaa1ZYqYECCm9t2oYGqzR2PJaALMRA?= =?iso-8859-1?q?TJvKeh9bwN4PoJWPDdeetiW+uIyvtOzONC58IUh9zykMx4kAdNCGe2LKJssj?= =?iso-8859-1?q?m2aO/FdoU0zdhxHleFgG+PdNVD6/uty/k0TqhRflW9hh9jGhHdoCQMjhapAO?= =?iso-8859-1?q?r45a5S1uSR0zToSPTBgY0GJAThoNkmwvQuhdkpYQqFIKNLwYMjPMT7HIuFUu?= =?iso-8859-1?q?Lnfpl9HYWQYPJiTIBToN3UyoaZDf9e+2KvmET7+pPrzGP2ZRM2CLW5ExtCYm?= =?iso-8859-1?q?omCh/Bur7QO7qQtYZoskuE7yKLAFTunYPldZubjpc9mrak6Insp6ntyZ+Pgm?= =?iso-8859-1?q?6+NVrjCD2bAPwvcTi6wc20N/dhtDpLYuToTNt3S+zFnWHY86ELBQzFxKjvf8?= =?iso-8859-1?q?u93gF7U+X9lKET/S5CKtLWpm5lu/i7N5WDvb71oGqzyxPfNoDeTYkCnZFvJs?= =?iso-8859-1?q?4UGlJUymnjaNXP4iRT7QriJ/+X6l2IbwAH+DK6ZWylsRyAvatlhpyJcuXKdI?= =?iso-8859-1?q?/dTfboSCGaRkUPx/7R5sbPNwZX2+MIgsac0LURMH0zmV/l80y+4mjExYKz7Y?= =?iso-8859-1?q?rRG1XVz07gBRFz4cSj7lRBWhcdUmvgDSgEU29j48W9sQjDPlyZUpTv/1yUJb?= =?iso-8859-1?q?kijZr5WS4ecm7ptXEmOap3WpHzgjD1H+sXGZmYmY0CzRCmrcLSy9f2ToFQJF?= =?iso-8859-1?q?UwJIdWSw5OG9k+Bpi+ues8r8/ZZXqlVgaCNDHXKfS77UKHq9dpwKn0ckbYWQ?= =?iso-8859-1?q?lFxd4k+XSPjmUlExsSr90uCHQTA5YHEni0RpBD5ObINZYisKSBoqKoQnUR/q?= =?iso-8859-1?q?wfhcO+Sg0Zz9KJdD/Kw1iNgy3MEotZQb5wLSoLUOLnF1fiAzQZdlb8aexkSX?= =?iso-8859-1?q?qY4YoWsRm5eQyuTkFkuAFzCkU9Fh9vqTMPSpswOcIuL+msarEovIem1f3575?= =?iso-8859-1?q?ytsv9qcFViUl3ZP1rSLbDCE82wNQ+Opr0HNEOemLi1f7uw8olqBSJ+1ndKrb?= =?iso-8859-1?q?CYfz9lqM5TSfheLcno8bVGfZyq8ZX0L2oFQ//WguIZTg0ZqSkVd8Mdqp+Yuz?= =?iso-8859-1?q?12F0I+bxg+v6xLmFfMl0tHnslaDArMaSMhWPbaRik4EcQ2A2uGaoqT/EsHcA?= =?iso-8859-1?q?bJqAoAHF41UxyjBqg6vUXmyKp7V/9eqijVnlqvbeR2mmGGRqF1WNcEbBWGpO?= =?iso-8859-1?q?PKxij7pRk0WVz57UMEv8aPPJiEeypXTKibMdFNIoHuUe7rphu+Ipx/7dQMTq?= =?iso-8859-1?q?n+bPltG4fpGIma9mr+jYpqaCdrCygABLHv+fbNoPJsMo7qyoZ/4cWulnPoxX?= =?iso-8859-1?q?MbSYdZVT+4WW9/X7W1zWIgvfoX6BCEY3BObW9pz6ZZssM63NXvm9O82MWo3K?= =?iso-8859-1?q?abpTqUFveEbOuxFVsMysig+M+qApSlTtlOUW45ui+aNP1gTmCKyPsglvZycU?= =?iso-8859-1?q?=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94689b5b-1c16-4afc-0290-08d9e5f59324 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2022 02:41:54.0963 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +fGwhsFM596OGIqEZ/gerMFRspIw5vahXi9n95gwlX0HGlXKK68D9mxdYpZBgl0TMp0EQ0HM4gTofMmGvmUEnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1325 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10245 signatures=673430 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202020010 X-Proofpoint-GUID: Le5L-JAhAI8v0kKCKBUis43N336OT-8i X-Proofpoint-ORIG-GUID: Le5L-JAhAI8v0kKCKBUis43N336OT-8i X-Rspam-User: nil X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 87F97180006 X-Stat-Signature: 9q1dzttdh3t9sthj6f333urtmbi96uiq Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=YwpzXNNq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DbMLWoJz; spf=none (imf06.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-HE-Tag: 1643769720-16174 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: <linux-mm.kvack.org> |
Series |
Introducing the Maple Tree
|
expand
|
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 2d9c59df60de..00ee01a14652 100644 --- a/tools/testing/radix-tree/linux.c +++ b/tools/testing/radix-tree/linux.c @@ -24,14 +24,24 @@ struct kmem_cache { int nr_objs; void *objs; void (*ctor)(void *); + unsigned int non_kernel; }; +void kmem_cache_set_non_kernel(struct kmem_cache *cachep, unsigned int val) +{ + cachep->non_kernel = val; +} + void *kmem_cache_alloc(struct kmem_cache *cachep, int gfp) { void *p; - if (!(gfp & __GFP_DIRECT_RECLAIM)) - return NULL; + if (!(gfp & __GFP_DIRECT_RECLAIM)) { + if (!cachep->non_kernel) + return NULL; + + cachep->non_kernel--; + } pthread_mutex_lock(&cachep->lock); if (cachep->nr_objs) { @@ -116,5 +126,6 @@ kmem_cache_create(const char *name, unsigned int size, unsigned int align, ret->nr_objs = 0; ret->objs = NULL; ret->ctor = ctor; + ret->non_kernel = 0; return ret; }