From patchwork Wed Jul 12 04:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13309574 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 38F4DEB64D9 for ; Wed, 12 Jul 2023 04:48:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4BCA6B007B; Wed, 12 Jul 2023 00:48:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFA976B007D; Wed, 12 Jul 2023 00:48:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE9A18D0001; Wed, 12 Jul 2023 00:48:56 -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 9FDC86B007B for ; Wed, 12 Jul 2023 00:48:56 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6D0F21404E0 for ; Wed, 12 Jul 2023 04:48:56 +0000 (UTC) X-FDA: 81001729872.22.8B7E10D Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by imf30.hostedemail.com (Postfix) with ESMTP id A01A480003 for ; Wed, 12 Jul 2023 04:48:54 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="m/isMuww"; spf=pass (imf30.hostedemail.com: domain of hughd@google.com designates 209.85.222.182 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689137334; 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=V0zmjk3m732t/eWPq5qXNEJLvruggBsecgrKanNe5l4=; b=pYQ8d1NkkECMHv4EdRQAsZtGRhjn6qI/hCwmhoDIh03NqmcrqmLVrmO/M6pdrn21EOLnS3 BYYpLdiuH5bkAeedXlHw+aPJwnn4iuCmXdvmAOGzhV1dt4MFpq/mshF3fovQF82hI2ARkx UEofZEl4IaBlUaszRDR+Dwr/IFCgizE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689137334; a=rsa-sha256; cv=none; b=ZlMrTidOw7PqEGoH5epKiVMwN7FlyLFZYfjc48/UJiPDrKKKx/JkR+tRyZ3GsQYd4I2alc 7rGt66DxRRjmjhq3bkzObe/8VTU4H6+5ITgsI/38PPFbG5+Bxjf4Xdu09/qQZTOupIXNc1 5R2oA1ZdAzpGp2dTV2qLrNFIhnvtr9Q= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="m/isMuww"; spf=pass (imf30.hostedemail.com: domain of hughd@google.com designates 209.85.222.182 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7679ea01e16so611500385a.2 for ; Tue, 11 Jul 2023 21:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689137334; x=1691729334; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=V0zmjk3m732t/eWPq5qXNEJLvruggBsecgrKanNe5l4=; b=m/isMuwwHCscXwVwjf5FGado4/9tpy0RVJn6Dmx5WLSJ5xRgosdxmCJxwiPFWiAUgB aDg+93flQ7NMyM7Ob0BhHijD3j9VUlV+wGsA8+lIFqohmEqvFNbAqrQJVoTH+NakZbfi v95OOg6esvouVDLtN6UUfJGUuwgdU5xNKi1Jbuw684xIT7LAHa0pkF4qQ3VLr3RBBpgQ WMQ398D7B7TZxSjDnWNUL6QIg9YQENcYddDXCtF/eP4Ub7TMj2kGD66Y3a+72i5I3Rkr ux5aoInLIYyejTCbPjnbhW+BnfTRptB28F88ToPfG11+CTmoDLEv5LUBQEcnAkEXDO6u 0U7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689137334; x=1691729334; 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=V0zmjk3m732t/eWPq5qXNEJLvruggBsecgrKanNe5l4=; b=eFzsPpS/W3x0pEQTqON7ioxISDN2s63uMbciJD0v9Bn2YzIUBBbQHSVsXGgQDQmXJt 6vmkDzSbIwWNUhzjqY1Qrn37VPo8nPUyBEMthr584clBqZ0KvKJHkFpnWt0WFdD+RMTx pefTWstwyYwFvr16X03DbGNjajSYTqGNFnnbPH0k8Xr9OuCe9yYSkvnWxyKmtpB/eJ/R 5u6UJ8vhpmiWFM+nL1485gdVPcXjIJiKujbCLDsdwQfCbF2FQY1jlnIiTT6h3drli6+d AN+dIh216dJEW9QJSzvg6o9zp5sdHA+AZb7SlDfeuJ0K5WiJeXXXPURz+IZpQlwLwegV oBvQ== X-Gm-Message-State: ABy/qLZdOJ2gf4xImv3Spf+V7Mnl+S1XCyiviQ4ymE/P8tmeczH8AWVn ctomKh+cc8L7+pM5GVHerDCsJg== X-Google-Smtp-Source: APBJJlEFW7pAKJkrMMZ7so7H+6qQo4Zhl/O905ULRzoeoCUXWypLVpWBJRwEwG5/0JeTCh7gTt6reA== X-Received: by 2002:a05:620a:404e:b0:767:3fa7:2ae9 with SMTP id i14-20020a05620a404e00b007673fa72ae9mr19722823qko.12.1689137333537; Tue, 11 Jul 2023 21:48:53 -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 m124-20020a817182000000b0056d0709e0besm972906ywc.129.2023.07.11.21.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 21:48:53 -0700 (PDT) Date: Tue, 11 Jul 2023 21:48:48 -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 mm 12/13] mm: delete mmap_write_trylock() and vma_try_start_write() In-Reply-To: <728dae79-5110-e3c4-df27-ce3df525aaef@google.com> Message-ID: <4e6db3d-e8e-73fb-1f2a-8de2dab2a87c@google.com> References: <7cd843a9-aa80-14f-5eb2-33427363c20@google.com> <728dae79-5110-e3c4-df27-ce3df525aaef@google.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: A01A480003 X-Rspam-User: X-Stat-Signature: btg649cwjyj74wwmur1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RPpox6qRr/SJLMVTWYVCb2JQIDKK56+a2X4YgcdG0ViBPm848wuFC8EieMAwzixY+Bn48/HgkeKUKpzRvLtTLDt0Hcoib9hI5Ij9nz3hfI99vKDdqlpjNuyxbO4vX0K9WbzKDV+DWLwdds9TOogabbY117pWZSmp9fDxvtMkDJ5Waafo4Jx6S+5LkLxpZpiktLTmxuVMsqC1O/8RQa5U7+Pg0LP+pm2x7B1ufP/2ODEWC46mp2zwrdZYtUOIbBB/NNk0TFtPvD8EpDAE4fOFlcnBuItuK109hbESMhBP5kOPGJ3HCQN6qt2pLb9RLeoF4vU+G/fTCR33FUV9Ru+N0cEcTrsfGb/k4oAmNFWWI1Uh56AR+W1UGmA0B+aHfZ7uNremnk0aJ3W6p45fhJvW+4HzHth4lELaOm9iu3iQMJ4NwhHEdeMoPNAeiSL4h5LpT+Sq+R9qNBMAeJixPnDk 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 --- This is the version which applies to mm-unstable or linux-next. include/linux/mm.h | 17 ----------------- include/linux/mmap_lock.h | 10 ---------- 2 files changed, 27 deletions(-) --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -692,21 +692,6 @@ static inline void vma_start_write(struc 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_locked(struct vm_area_struct *vma) { int mm_lock_seq; @@ -758,8 +743,6 @@ static inline bool vma_start_read(struct { 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) {} --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -112,16 +112,6 @@ static inline int mmap_write_lock_killab 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);