Message ID | 20211201142918.921493-3-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 E4F0CC433F5 for <linux-mm@archiver.kernel.org>; Wed, 1 Dec 2021 14:30:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904EC6B0074; Wed, 1 Dec 2021 09:30:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B1EF6B0075; Wed, 1 Dec 2021 09:30:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B8B96B0078; Wed, 1 Dec 2021 09:30:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 5EB606B0074 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 09:30:30 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2327E8249980 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 14:30:20 +0000 (UTC) X-FDA: 78869460600.02.4613CA8 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf31.hostedemail.com (Postfix) with ESMTP id 2B3A41046306 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 14:30:18 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B1EP50X018237; Wed, 1 Dec 2021 14:30:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=QUUmOptoT//G+arebZug5MSDuhuq9/8Lx6E8dBP54hE=; b=Y7lv1PSHv7fvI1FHP3Wd0WNNFTpoXMA7h7MZu4QMDDiBY+O/Pjz5KF2f8KX4W50/UZeF Lt7uzcu1n+SgL/mmw66ToLpEQiunfrD7odzTd1iXqlLZCr5Dt/F/dhWKAy6rb6lrfCWf YrFjtYWCETpLiRD+2UidgUTLvbZNMdOP9DTB6AOHFcfoQpi2VX3V4djRv4rqVM+OEXyl PK46u06lbbgtrriwfq9obqQIOeIHr7gXIsH5dUDfuoLarwQjHW0teBe/SfSqQqqIftMJ OsU7iZYGFS8IEK9QeOB31qQC9nraoMoWlelNS6TpLyg9P8kTrHOvj3pVDIdJ2mTa0eYY EQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3cpasyg0wr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:07 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B1EALNd032204; Wed, 1 Dec 2021 14:29:48 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by userp3020.oracle.com with ESMTP id 3cke4rv3t3-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:29:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=em2Uy3d46Bjpsfse05ftBk10TKZoAse2gOOoiYomRw7jeRCXmkuJpHr2yOxi0RXLAbX4zv0Jml3L9O/yzJ2KawEk1NO3heJu4Mv4e9yAwCNYIXmMtXytxIFfJNRygrB6qHrerPLabtBrSFvFkiy0gBSsgwnrF53aMctc8t9Wsi9jwWLK3+KsjCuWI3f1IEaeobBZ/CJINZEuRzqRL8j76ZqyAPakKwHtpyj5AK75QjMfnuLuX6Qm2HCOiYIvUtOCJpX+FCEodrewFFL1zGLE4X1gDYXziBWlrj8R3XPAnTQNbhgvxBogooQ3Sht/jxT0vwNAi3VILbpGHyDiCbv+6g== 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=QUUmOptoT//G+arebZug5MSDuhuq9/8Lx6E8dBP54hE=; b=Z64xs40JBUET+e5Kds4JL6CzC8xT2IGp4h+TzGoz0etw/6EQ4El9epKq5Zm7UKCXyb0PlrV2TrSjwDouy5zswrCw6ZgQKrs9H4xqNZeUjeZntODQDyOMiPcmpTQ9yRc0ZeVzNrSZza7DU5LTLTr+XNQH2QzeR8Nhy7ZCDQsQeeNiKyPlG8mIyN7ki8GgxNTOGMSV/426Ral7OT2qVDVVU7SWPLElbikfkdjCMgupD29bAzpf/mg42Idf3NgSlBLBmWD+RYpiHfzcELT7PvdBZ5U0lI17wrz530Oi579rEEpoXJ4wu8ZMe/AiBIHT0VAP0J6AfUXyOm0COnhr1ZToYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; 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=QUUmOptoT//G+arebZug5MSDuhuq9/8Lx6E8dBP54hE=; b=eLrJw/GJUzIWOBCXiqPlgLs7wMeEdGFAePy4mtIx9zLx3hb41nNXdbaqsPtK8PyZlQM7Cm80X1/mkW3MKyFFQcRFYDfS/U1lg0v9Wm3OkFe63c02mEJP588DYcKQMg1vyXFbFzniYdQJr+emy6lJnLHz+Ts3HrBxNkmi8r1O1/A= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA2PR10MB4682.namprd10.prod.outlook.com (2603:10b6:806:110::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Wed, 1 Dec 2021 14:29:45 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c4d0:8291:84d:ac66]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c4d0:8291:84d:ac66%7]) with mapi id 15.20.4734.027; Wed, 1 Dec 2021 14:29:45 +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> CC: Song Liu <songliubraving@fb.com>, Davidlohr Bueso <dave@stgolabs.net>, "Paul E . McKenney" <paulmck@kernel.org>, Matthew Wilcox <willy@infradead.org>, Laurent Dufour <ldufour@linux.ibm.com>, David Rientjes <rientjes@google.com>, Axel Rasmussen <axelrasmussen@google.com>, Suren Baghdasaryan <surenb@google.com>, Vlastimil Babka <vbabka@suse.cz>, Rik van Riel <riel@surriel.com>, Peter Zijlstra <peterz@infradead.org>, Michel Lespinasse <walken.cr@gmail.com>, Jerome Glisse <jglisse@redhat.com>, Minchan Kim <minchan@google.com>, Joel Fernandes <joelaf@google.com>, Rom Lemarchand <romlem@google.com>, Liam Howlett <liam.howlett@oracle.com> Subject: [PATCH v4 02/66] radix tree test suite: Add kmem_cache_set_non_kernel() Thread-Topic: [PATCH v4 02/66] radix tree test suite: Add kmem_cache_set_non_kernel() Thread-Index: AQHX5r/idawVc/vQ0E+5av3PP0u3Tw== Date: Wed, 1 Dec 2021 14:29:44 +0000 Message-ID: <20211201142918.921493-3-Liam.Howlett@oracle.com> References: <20211201142918.921493-1-Liam.Howlett@oracle.com> In-Reply-To: <20211201142918.921493-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.30.2 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ce31031e-9104-4120-b96c-08d9b4d70563 x-ms-traffictypediagnostic: SA2PR10MB4682: x-microsoft-antispam-prvs: <SA2PR10MB46827A075A8DFAE856BD0EECFD689@SA2PR10MB4682.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: BgY29I9Hn2kERrzIZQzhtDtiKK4Licowmas0enzpYGOd3na69beyG4HmbBejF0p6ZO1b0wdJ0gs31Pxp1g3XHaRdF4WBUyjw4bPc31VnP6UZLNhcAoNgjUVtUtSTNhNtUrPS6BMWxB4qxAD6CMCGSdzDXUiX+uudlNHNpHsHRoUT06iE5es89hljoaepHsdI0xbRqiGULg4cruPxt8qh+ngl6l4BdOtA5IBvP6av66HYzBwJoeZSTnK9fCoAK2Wk27izSvlw+o/USSxOD3EPcza0JU5AfPSUwoOoXl83ECy1cXtlpXPFulvuEJV0fA86L5HHKF+QS+alFgWY2Nr/14MikA65SVXJSOtFqNEFaaLfbUcyNPwFwd7NFxLpCx+L03QU744GhtLVxsrukUQ26y/zpvZHLsTZeFXbI047cTW13aaD40eQMlT3uNF4pp5JwB/EKgUkS4JrraH+u4QxivxOlfnT6iAV7sdkkzZ41159lWfuLy99EfvPK2Zu440Hl+NQVdPug4xFYvA62t2TfzDpUTxSmuu6gXYSpstrbE0ObvGINJOmZyv/RRoqtFDsaHIVURXOrT+C1cReTc2ZQl0EwV0X6dVMmimqVnWinoY6/Y6b6hravQXZKDLFD70nf7X5vtZ89XajKr9O4GdYo2RIk2gziMKI8+sDy+hqG/FrRw4lxe35dcvwG/l6TVvs 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:(366004)(44832011)(107886003)(7416002)(2616005)(8676002)(6486002)(66476007)(36756003)(122000001)(1076003)(71200400001)(38070700005)(66946007)(6506007)(86362001)(64756008)(110136005)(83380400001)(6512007)(4326008)(8936002)(26005)(316002)(38100700002)(2906002)(66446008)(91956017)(508600001)(186003)(66556008)(54906003)(5660300002)(76116006);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?ptOGaQwTXo7ocwF5TLeNWx/?= =?iso-8859-1?q?Tq1+Ml4n8wKt3mUD+sd+zkEKX86iREzYd5BwPhmc906GEqvCRj8Ldxgzcbdg?= =?iso-8859-1?q?nsa3vt3VHOM3gQ74jtr7n9eTh9b8mjfwZivizLBtLattIQtFy5o+XzlRdNzL?= =?iso-8859-1?q?/aWRZJ3SIBiPbNggND/q7fGKMDu1dPnayckvgGMyfH1FmQV2xj3NCZ4uRzZ9?= =?iso-8859-1?q?L3eHWwyct56ufxzxt8cq80utTWV+Uz5/Bmoif3zOxWpi4kyR7eZnkZ05TkP9?= =?iso-8859-1?q?MAng7iAVZbvSq0MkvB5Syf9YLQw8XFYJIKgz+Qs5/ImhcsqNTk/TUSfGhJLv?= =?iso-8859-1?q?zfuSsy3imOZakZ7dRlsjtd3D4THaHhgLTL6pA7KPip0fs3QlEQsjmCevbBbG?= =?iso-8859-1?q?Y3/job4tVwisSd71eBmDjXYxseVa9kHHp0SV3cKO+68cYBH4IZt1L1YS9Ylw?= =?iso-8859-1?q?pXfcA8QGq2eOiI6MPqqi5qrMBbeaX1Hormetv5pDXvw2srqpXqMCYUmFa/eS?= =?iso-8859-1?q?QPia46t2qt6WjWOET5OAfuRH1/mCbh4SEkzIM+zkniuOkfAHc06hUsAM4eGo?= =?iso-8859-1?q?Ne9IeK09XtUohhOm+yEq8VfMPfQWrz7twb0siNwwh438/kAeB4jdgJxK+jdo?= =?iso-8859-1?q?DcxB7ptEAMMq23D+Quptopw6QXLWwVeIIzcYxo2y7ebB8WRvMHRTRQeCZGbA?= =?iso-8859-1?q?u5IHKg85ocnk4k7VwMGOU7a7e68RJ+WfnwDBM+I8fA6F8qMSWuLuuPri5ddd?= =?iso-8859-1?q?vE+X7KLQnXCDbsxJYzZPWietYMDVeI1csCXrppKSlZfVEDoaZsO8hIgX3UXC?= =?iso-8859-1?q?b4PezYInC5ix0OsSaWqtePWW5Ef/VsWqiY5XIcxRECV3AMn3/0ozojvAWS8s?= =?iso-8859-1?q?RmdlLVkN6hHKA6x8Bh5tnK84kgTC4vLoVEpJVgnFzGIp82X0v1YAzHzSDf0Z?= =?iso-8859-1?q?rm4z/OTuahXnTwZGNH0lOogtVIzfpEHKqiByoUasugBNc5K8TdfDkWGXLwzu?= =?iso-8859-1?q?4bllB7Cq/XivE0ewhW/HgabWtgJYhjllEIOvRmBAXt7iF5MH10hBOtvmxbcQ?= =?iso-8859-1?q?8yg9clvqpSwKwp9jTDT8n/fhrA3ni05xnRa3o4ixONs2bRvyUVtEEizt0V+z?= =?iso-8859-1?q?kdgfiH6QJnJ4nnzo4aex8fcDAozQslCXOhPKbqnDeSS4CP+KePl4XmIYkMDc?= =?iso-8859-1?q?NDaAH1TlhMPg16dI/dXoACfnMzomdP8QIFtv1BoFRwI9sTS9sxVV76fsmwoA?= =?iso-8859-1?q?MeAw/lC4kQUmMhvoxprJpR5I4MT9+0dPbv5b+eAuPczRPUBtOubhaZxHPkWv?= =?iso-8859-1?q?FcqhBAKjRSorQglqkIgFiGRAMhMWb681wQLG8y18XrXQtho07dq4kgfzOUD/?= =?iso-8859-1?q?qSVceCCD9yF4KLYaCTcMu53VN44Gp95ZllAqcCkUQ9pTxI/dpZfD6Wx3gIzQ?= =?iso-8859-1?q?EY+Cm2M39jOZRafcdj920w+vv5tiBHhicw+S3aPs5+WT1L2Zxqwm5EaC5QLn?= =?iso-8859-1?q?r8jxUeoPmXf+TRqpGE2tJC0MKlw+lUBcb/Hx6tPfqFwVX0is/3rIqoAYPHFR?= =?iso-8859-1?q?p6Nz1/bdPsPiZwzyXVDAb/5motoRszKIRByDVAupV1oOKW0Jt8G2qcYc3Kcr?= =?iso-8859-1?q?lwVjKpA93lOrp6VeMmw3SZcuSdYoLhYqGj6tapFW96i4/lm8Vq2LvYFudJXM?= =?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: ce31031e-9104-4120-b96c-08d9b4d70563 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2021 14:29:44.9846 (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: 8es5czE/dJSsKDRfN2Ls2ilC6CPJ0tZO5s54NC/DysmpRL3ruXdATJuID/E/EBI3FxA9c0BgHsaYEsvWGUov5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4682 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10184 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=967 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112010081 X-Proofpoint-GUID: _RhoPdiiGpGATcP4W_JNwqrP2zMsU0IE X-Proofpoint-ORIG-GUID: _RhoPdiiGpGATcP4W_JNwqrP2zMsU0IE X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2B3A41046306 X-Stat-Signature: 475ysfyqnwg1z4qpmnc584sqkkm6o57c Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=Y7lv1PSH; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="eLrJw/GJ"; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf31.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=liam.howlett@oracle.com X-HE-Tag: 1638369018-583045 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; }