From patchwork Wed Jul 12 04:44:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13309570 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 34749EB64D9 for ; Wed, 12 Jul 2023 04:45:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9BF46B0075; Wed, 12 Jul 2023 00:45:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C23ED6B0078; Wed, 12 Jul 2023 00:45:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC4C96B007B; Wed, 12 Jul 2023 00:45:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9D7C56B0075 for ; Wed, 12 Jul 2023 00:45:05 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7C45C404B6 for ; Wed, 12 Jul 2023 04:45:05 +0000 (UTC) X-FDA: 81001720170.09.CBA04F9 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) by imf12.hostedemail.com (Postfix) with ESMTP id B0E6740004 for ; Wed, 12 Jul 2023 04:45:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=gzISCkNI; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of hughd@google.com designates 209.85.128.179 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689137103; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FwWrXdLh4e+ZZMmHSG9GahXduxLzpg1IKzk9+Pois54=; b=vb1E5KtnisDjUF42y6zl2LQb3VKv/YPeJ3ecjVxufwvVKPRgzQTKJk+gvRvdwTNkWweupv W1KvEXJPwGLansVt6Qi3PwKmyQhdW7twEYsyUuxPVBdBJgvLMZlpHGkTPo2kHqIiU6a/yY l9KrAf5jWx3N2V1qb+XCpRxNe+klFnQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=gzISCkNI; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of hughd@google.com designates 209.85.128.179 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689137103; a=rsa-sha256; cv=none; b=3o/XrNoWg3L+L+nGLT218SMim8PT22ML5NcPht8YdzvJ999Ew6u6iS+mL8BaCcE33Yoo2+ V9oQcsatPE0nOhtMDFxT9zb21RZUFafvs/lr02dQ6Ka0/TOVoNlcd7PvIGcCviePdihkiW XKS9aWj19SFG8YyRfhJlusI6974BpHI= Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-5774098f16eso76651467b3.0 for ; Tue, 11 Jul 2023 21:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689137103; x=1691729103; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=FwWrXdLh4e+ZZMmHSG9GahXduxLzpg1IKzk9+Pois54=; b=gzISCkNIkoYstaiURssLgcAP0NHrER6I1tuZ8rc0Qvm4Mprsdiz1G+fVe2F78Gadly Zd6Zv7R4mMYit6gDmv3ASM0ewnC89JI2TxXgi3FWSUoDcd6h1cjVrlXHTbjoLAQWnXuN ZQUv1RJ1RAUpKOWClvwrVKEYf90QtijHOwpAofLxIipQ4ubW+8saarTIudeMK/r5lyew pHuqVs8/tIX7WT6ZYHIjSpcSZfFYwHc9ruaHZLElCwezBNkxHQx4zaVjKMhWpdolCgWJ CTIkHHX4v8I9yJRfGqJT3RXI/emCB7p8zIkR9VuDxyTUEDm4M6z0824h8U/TQtrRCylu LH5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689137103; x=1691729103; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FwWrXdLh4e+ZZMmHSG9GahXduxLzpg1IKzk9+Pois54=; b=howVR6xSXyZbSAhXJ1/+GmDTvZvvnG9HdWH37T9eUaBriChSs3uB/PgXhfGVIEiGQO p/JpgkRspN4eIVgvddIPnhOFj8WCnQeZAN+v+miapSNMNIuL9pIFSxBNQSPwideSZIQm hlr/TzULYG1piVoTr5L4NvA78+/7LFNntwa4sjO74PeyUnyKSWayihUBQgzFHJsHlnJt +Cob2sgMWOMxRrxw1dt14zprhQhuxMTH4G+WSniq+S2gFEZqj8IdL1AIHTTb4/FhtxtW U+kKk4/ZE7HoUW/E1rYI7M2OvcKWRwv2hkw8NbdPFo/yyqY3FdPPnkr+CH8cD3VRxnRl tMew== X-Gm-Message-State: ABy/qLYd4nHDQqM6op2/Hl2Q1ZDO1IWm67fX2aRe55mhu44S8TN32bjg kSGSc2LpkkeJfOoTCzVXhOI2AA== X-Google-Smtp-Source: APBJJlHRrkvIp6Bta0OiFd96ROrSVoBT2nJnQYkUAOeyOnPlbKa4aui5kARvVpJZZxshvdKBo9N7Xg== X-Received: by 2002:a81:ab51:0:b0:577:bc6:6f8c with SMTP id d17-20020a81ab51000000b005770bc66f8cmr17906536ywk.26.1689137102617; Tue, 11 Jul 2023 21:45:02 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id r11-20020a0de80b000000b00561949f713fsm993186ywe.39.2023.07.11.21.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 21:45:02 -0700 (PDT) Date: Tue, 11 Jul 2023 21:44:57 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Lorenzo Stoakes , Huang Ying , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Russell King , "David S. Miller" , Michael Ellerman , "Aneesh Kumar K.V" , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , Alexander Gordeev , Gerald Schaefer , Vasily Gorbik , Jann Horn , Vishal Moola , Vlastimil Babka , Zi Yan , linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 12/13] mm: delete mmap_write_trylock() and vma_try_start_write() In-Reply-To: <7cd843a9-aa80-14f-5eb2-33427363c20@google.com> Message-ID: <728dae79-5110-e3c4-df27-ce3df525aaef@google.com> References: <7cd843a9-aa80-14f-5eb2-33427363c20@google.com> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B0E6740004 X-Stat-Signature: jg9p4hceq7dt5mstukid3wfhe3x8qp5j X-Rspam-User: X-HE-Tag: 1689137103-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kvOvWgY4PV88bKT/jVy+uXZppdz3JxZM87jhFGuLFzcxdapprTwyOmCKuiqAsxHcKmPuGEtWK2EDJX9gHIUmU1UaNXqMiHADflrnUWF1NiJKXKT7kUSiPAUGAT2KIk8kvczfYy+Iig4dCaXpVy5C9tuK2gBZ0ubBDfNX+z49UkjkspGzedjqZjDCMaqTKRoFcWXUgDk/wv7PdGQdvB+sScddXpGmfYKVVdtIan8ygPxANIqbNb7KFx3t02RSN7iW3p9UzKVih4k3rqpbHwYMECCr2EaSFQ1D/RpZIr4h8/DnHQf5UDttoFd1zlJsqGSBZ8yvRcekacjKhNnTKf4ZH1Nvi3o1RVj0v2Ya9uzCd6OujxBjpqE0FXhnNB3g0U5wNiLU/5OSCEXfyBlikPMBtqAeQSyl39uEC5nmb7ZFyX0LE50/cmJqUokDn4F2MXWZ7lQ 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: mmap_write_trylock() and vma_try_start_write() were added just for khugepaged, but now it has no use for them: delete. Signed-off-by: Hugh Dickins --- include/linux/mm.h | 17 ----------------- include/linux/mmap_lock.h | 10 ---------- 2 files changed, 27 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 2dd73e4f3d8e..b7b45be616ad 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -692,21 +692,6 @@ static inline void vma_start_write(struct vm_area_struct *vma) up_write(&vma->vm_lock->lock); } -static inline bool vma_try_start_write(struct vm_area_struct *vma) -{ - int mm_lock_seq; - - if (__is_vma_write_locked(vma, &mm_lock_seq)) - return true; - - if (!down_write_trylock(&vma->vm_lock->lock)) - return false; - - vma->vm_lock_seq = mm_lock_seq; - up_write(&vma->vm_lock->lock); - return true; -} - static inline void vma_assert_write_locked(struct vm_area_struct *vma) { int mm_lock_seq; @@ -731,8 +716,6 @@ static inline bool vma_start_read(struct vm_area_struct *vma) { return false; } static inline void vma_end_read(struct vm_area_struct *vma) {} static inline void vma_start_write(struct vm_area_struct *vma) {} -static inline bool vma_try_start_write(struct vm_area_struct *vma) - { return true; } static inline void vma_assert_write_locked(struct vm_area_struct *vma) {} static inline void vma_mark_detached(struct vm_area_struct *vma, bool detached) {} diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h index aab8f1b28d26..d1191f02c7fa 100644 --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -112,16 +112,6 @@ static inline int mmap_write_lock_killable(struct mm_struct *mm) return ret; } -static inline bool mmap_write_trylock(struct mm_struct *mm) -{ - bool ret; - - __mmap_lock_trace_start_locking(mm, true); - ret = down_write_trylock(&mm->mmap_lock) != 0; - __mmap_lock_trace_acquire_returned(mm, true, ret); - return ret; -} - static inline void mmap_write_unlock(struct mm_struct *mm) { __mmap_lock_trace_released(mm, true);