From patchwork Fri Jul 28 05:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13331186 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 6DF3BC04FE0 for ; Fri, 28 Jul 2023 04:48:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C36436B0072; Fri, 28 Jul 2023 00:48:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBF426B0074; Fri, 28 Jul 2023 00:48:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A87B46B0075; Fri, 28 Jul 2023 00:48:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9548B6B0072 for ; Fri, 28 Jul 2023 00:48:32 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6137C1C9416 for ; Fri, 28 Jul 2023 04:48:32 +0000 (UTC) X-FDA: 81059789664.27.FC17A70 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf17.hostedemail.com (Postfix) with ESMTP id 7DD7240006 for ; Fri, 28 Jul 2023 04:48:29 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690519710; a=rsa-sha256; cv=none; b=Q8Eur2bLbdBX8D7gtHfoIHuaGri01/Ib7K+q6pSLL7C1UEwxL/cSMoKxVuNCtjJ2XeoYpY w0bJKH1NVZwEvQlnh6wAOPFVwkj13ZmgPwjO5S1ZPXbBxQ4v0Yr1aKH1+iQSDWCV6CNhc9 hWBsHCkVUcwcaVuOMZOxeokApee832o= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690519710; 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=SrGlprF5Mjdz6aRLfbwyiwXefMKmMaFHV4CQs4Y77aI=; b=fdflugiWqI0JmIIaNHdLQ11H6DAyuybxoa3gp22QigequCRv3JMdUesiSww+MKlCxCiH9F hZTooOXonielRgaLtWwRzd5BY2+Vtx1yxad6sRFBu86o/pEBzeaNtmZQYNXQj4y4cv2PEB tm3EQRGH8j0GLVxc7lZdj5sa1oo2l28= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RBw7J1clyzLnwj; Fri, 28 Jul 2023 12:45:48 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 28 Jul 2023 12:48:24 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , , , =?utf-8?q?Christian_G=C3=B6ttsche?= , David Hildenbrand , Felix Kuehling , Alex Deucher , , , , , , , , , , Kefeng Wang Subject: [PATCH v3 0/4] mm: convert to vma_is_initial_heap/stack() Date: Fri, 28 Jul 2023 13:00:39 +0800 Message-ID: <20230728050043.59880-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 dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7DD7240006 X-Stat-Signature: gguxuqarbgep4864ftxm8r1tyxguh9dp X-HE-Tag: 1690519709-837389 X-HE-Meta: U2FsdGVkX18C2m4lOH4iAdcKhZ8hiClwWtSDKQKRjHqi+RfHjSP7nDSPF7XrQwr5tLlAqKpQLfuj1AXxXyl2ohz7D8GW2faXKVyXX3iLxdNlK7X8mDyIvHT6p/nA9A039mg7ymqrMSmBsLnjI4XGtdtI9c9kQK9OAuEhPiHSVkhxZwD4P3uV/WEmbqdzuBeVjsE7V6Qmbfka2WEJkOaj0Gkl95qcjcUaQ3KJ2zTYyBgYKwktZyyxz83FilhzwtZCP66ucN6kkTRNbMQnEjREMpG+iN7rtbealxXJlqOaZBKXAegKXggzxRnbXhfJH6ZztlWuUi9DynUyaXavuCcOSFbulJSeB6HLBicg7SjO2t8f8KJbVlSvp40Sm007RTWoG6CPXhFWcIhILUHfNUwzCYoJY8A2IJ9VZ+1JeSCeEusCp4hlqU4YIvbo38TWu8D/4Kvq2/aUaJhrp9LVsFmnSqMVj0HqgZb77wyusSAfpyMIwu0yHtTTRXiouHwE5Q6cM2KfHAqwjGa1mldWj5IymFbhSek+WsdZfGsBcfIww/DpiS6qk2GvXS/pvu7sBvoUQTDjnKDwf61o6KRKWjBUMjURWw040c6SOTIJRSRgQ9MFEx+JOmTS1cX5bmn87D5UClnfcPRrPUf0M/GumhyF8IEYV74oBbEnRakEAr9Kv1WPvg4RiBmx7KcxHUHLoopzCzinGta3gN3d4UcA1mRFWnfi7JdQlxwNhR5QBGGoOOnW9j2wBd2ODAGFYZbvb9zBOhTF63LcwWNE0zPxWACNo+a/Kyc+4kAG5H0Kom1xkEWeN3iFwkcYy3vt3BTTgYkt0SfsnEKO78QQkCdXiqBUdD3HChSRkEhwrqGoEfbqA6mt6vOeLgNOXyvLaj6ewfnN3QBklv/3C4KziIhD0xvLlD2uyRXSTjH4Y4D9J2njH8EkpWKCVmBTULpd+VpEGXEInlBhadEY2xM0Z6nWB2U Mo42ei4K /NmyF2s/RsaNOMK3JVStb0e98vSsKWyXYzccA+n/2edSUfPdUvun+VJaUYk8qdrPZID4Gi7Ew0ny2ESm2EF8jXZ6n/iIcFUBjccs0Qq7KDwcBsJMoLg1FufCslfz4lPBFwka1ooqBVs5olXZ4pv8RXfu2+/S385nyIF3INsbdS1PuENbi5i336VCVKzJw+rTcrCBfAe9oWHHc2a7pSmuHghWC29cDwXSz9nDTbULkpwareOUixx7DMlE98Y87x5FEtutn6dH/irwGeDvRvLnqR+C5MA== 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: - add comment for heap helper and remove one more goto cpy_name, per David Hildenbrand - add RB 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 | 25 +++++++++++++++++++++ kernel/events/core.c | 33 ++++++++++------------------ security/selinux/hooks.c | 7 ++---- 6 files changed, 44 insertions(+), 65 deletions(-) Acked-by: Peter Zijlstra (Intel)