From patchwork Wed Jul 19 07:51:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13318464 Return-Path: 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 BFC71C001DC for ; Wed, 19 Jul 2023 07:40:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB2188D004C; Wed, 19 Jul 2023 03:40:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B99D9280036; Wed, 19 Jul 2023 03:40:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C6B08D004C; Wed, 19 Jul 2023 03:40:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 756928D004B for ; Wed, 19 Jul 2023 03:40:13 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2AEA51A0199 for ; Wed, 19 Jul 2023 07:40:13 +0000 (UTC) X-FDA: 81027563106.19.99E6E74 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf16.hostedemail.com (Postfix) with ESMTP id 83666180017 for ; Wed, 19 Jul 2023 07:40:10 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689752411; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=FQLRJXgV60ajiUrnsrtbH43Bc3wb3+EorjdQnI9ybck=; b=UnjTxPtZdHhu+O3A6mDCJW1h/uo6zpJ65IzSYxFCQ3MTgNgH5J1I3YDQhgMvMF8hEaeR/O xDh4jgKX/rQvRSNlgf8nytMwoJjCyxPcx26Jm5aJ0kLUKtsuOeAZPHNPLrAhx2Fr4mAWCO jlxsQK6G39UqkhsHijJ0T2zhLkZTD4o= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689752411; a=rsa-sha256; cv=none; b=paeODWc1RhD2QojtfK52NWgNrNSvUr3WrFv9x8o8Z+KhyxLxKkgsiDwLCa7OpXViBMGWeN cgp+Vx169q4YQLtVu/imAo6SMD7IGbOHyjMcA13JRadB+K/NMwUNXLaU3WXS0WJ0M5Q5gu 3LKJ5Ai0UNJMX7vkNyCxyKabUOQ/4ZU= Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R5SPf3rLczrRnl; Wed, 19 Jul 2023 15:39:18 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 15:40:02 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , , , Kefeng Wang Subject: [PATCH v2 0/4] mm: convert to vma_is_initial_heap/stack() Date: Wed, 19 Jul 2023 15:51:10 +0800 Message-ID: <20230719075127.47736-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 83666180017 X-Stat-Signature: 7ogqiau5mk7isof674zj6zyryyygomgw X-HE-Tag: 1689752410-478927 X-HE-Meta: U2FsdGVkX1/UkhazjZji/8+rvY3iMz7G9OWmrcfvq1sHWRqywsU2+Fb9KaDL5mt3F9Do2ZCz2IyyvaOSHI0eFtoKH/VvOH/f3Tt4o+UJTgek1sYZ6I8g0b83EYZEJrXEcgPL5G9SRkrMcsCgYVm4L4Ot05ELRdPPmLfEL1bGWsmE5KRujhh0rX61xyeqwv3p7jt16Bbb+vg7kBeQVSftFZCD266fyD4RtuYACEFTO8WUPcRMwldRLs9W9WLSC10TkYclU/KB1TKgCEG1w4zeXgZ0Rbi/YHBZK7zxLNNhsXODZ2qygxn9wpOJAhYqJeBnC7fcbe/Lvb9D623F/qYi/tdwIXGy5sR7LA4VjnebIL3M0AY7LuzIQ6J7TCXswh4iToXA50STerg/+yB8fXA75Sjw8GX39aFpTL4sIqEftC+PQD7X2Xi3VZMHzTL9hL+I/yv68DJirMuORW5Ls6ug26SqZF1Zqa63lkRvZSTRnyAAcCydqC8AICjmuuDZvYuEFUxarvZSxE/7m9JYpDRvKFQWmJyVTohSFbh+tiR6dh4nq2stGLFWDPsMD+LKoAcohg/JehmpvjMgwDNLKw5y7Xo7WfAxtr35P7Zw5tU0OAdfFMQyixqY51jsoiaRskgSd6epXOnV5ZSSy1LVIlx2TIqXygFblcfP72WhCET03fkFSf6A3HXHhXp1a21z1rOx4fUe/ilrmJG6Z8FSZuH6T0PlkTsYIrWCLcosP3C6ps7qx6C+VJF12wyei5rv0d1VjYpNs9EXAfzjFTjTZpcmpfqZfwg13CjVqsCyP9ytRAswRbVtmh0RkoU+mL0PMCZs1HBpEE/cU75YEbeF1VOTcxxqmJgIkvUnSEfkMjsRKRpPiNIpTtzzcXuNYMvOhh04eTKWS/FarQFDcHDFMm6hC4FoUuQm7Os+oEaa7H4qaNbsifR5x5ZOrJEeONfZJSMj4Lsr6QAQiHpFBRNL9+r pNburiW9 oRe+EtqgHtzASjw9z3YkpiBwRwhunRareWPj2utARHNBAJlPsiBEigdThP0nYtldd+DYJX9oVAvEfS7socVMcfAI2wiVbpNE/m6us72z5M6w5/cJXlUq9HJaQjEMHI6ypts76hhymRVkAI7DitoQPwKU6k4oTxpQ5Uixhs4REGoevrQNQDEeUR86gr3SKLdEJTcu6r5G4B3n9rRY= 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: Add vma_is_initial_stack() and vma_is_initial_heap() helper and use them to simplify code. v2: - address comments per David Hildenbrand and Christian Göttsche - fix selinux build Kefeng Wang (4): mm: factor out VMA stack and heap checks drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap() selinux: use vma_is_initial_stack() and vma_is_initial_heap() perf/core: use vma_is_initial_stack() and vma_is_initial_heap() drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 +---- fs/proc/task_mmu.c | 24 ++++-------------------- fs/proc/task_nommu.c | 15 +-------------- include/linux/mm.h | 21 +++++++++++++++++++++ kernel/events/core.c | 22 +++++++--------------- security/selinux/hooks.c | 7 ++----- 6 files changed, 36 insertions(+), 58 deletions(-)