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: 118826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp927608vqm; Tue, 11 Jul 2023 22:43:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlFoA9OAwqK5chRClWti+vO/nBSrQlXvU4GEQ3DN0M6pBdhl7ZTGEFzmgoE0tOLoZdNRlxs0 X-Received: by 2002:a05:6a20:104b:b0:11d:bc14:85ad with SMTP id gt11-20020a056a20104b00b0011dbc1485admr16857371pzc.53.1689140602985; Tue, 11 Jul 2023 22:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689140602; cv=none; d=google.com; s=arc-20160816; b=p+6ZaOAKwRtPvjPf5cAuWPGUUmkEyuMunvQhdj0mUE4+60QjDfstTooLxUFgCgo5FH 967sjqT4wo3WUALoGOKCmcpD/elBoaWM8A9f61BFsc8bvXB8ImOUxdqDCGsVGJZJd9Jj Dx2hlXLlnD7FfrA/Zp3UldpQrlmc1WO4xq2I25wPB9XFIwpBiKAOETcrgyl8oFH9ehJC vyXY6fGm01Gr0SmHRwcojhhvuJbLZB0o2N4HEOck3kNr3Y0UTD9p/3y3aSjas7Pdws6k 8u6BbpVrLc/fnDKy+6X2GB4gXD85VzuhbZbqXwTvXVioRpwUIOIj1dDboFBiTiquTxqX W8cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=V0zmjk3m732t/eWPq5qXNEJLvruggBsecgrKanNe5l4=; fh=F9IVpUHia72ABF8rrQzDtAcJe241JKL7UyOA6EvSYz4=; b=TIH+WFrCPPAYbGcKxtxykeE8IjiKJshuIZtbuLokR+MysXOVRln9cIYbGC3QCgBMM3 YHXyPnBfyl6BCXlU3BpyBzUhL+AnH5FAjCwJQl/rhtIU7uxM347gNQUpB/m9CaxtqS+R CQTV95uro0BGegammYNt26Eu8+9vPZZuceDbVbpFkzYUh9pJtVTN70E86RwNlOy+kFof Qz0mFWWU71tKR70gFuhvi2nILQZ0BJDWc3Zqe2+7p2uHDyoMpSfpSdF8TegxLhlnDl5d +YFyiClFfuD40qpvRJsCZi6j3mNuZBJXo5Tx5I4VMAuQjV6tUvC4PXO2IbzmCHH1JkiG h2Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=tAltrJ8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a056a0022c500b00682f9a7b681si2635072pfj.216.2023.07.11.22.43.08; Tue, 11 Jul 2023 22:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=tAltrJ8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjGLEs7 (ORCPT + 99 others); Wed, 12 Jul 2023 00:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbjGLEs4 (ORCPT ); Wed, 12 Jul 2023 00:48:56 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94346E5C for ; Tue, 11 Jul 2023 21:48:54 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-765a5b93b5bso611468085a.3 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=1689137333; x=1691729333; 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=tAltrJ8qMr5yXVnQZuMMmsi4IPuKxAEYvXvmeooSI3v5NqdP6qPUWbcm4zb7tBU4h0 936uy7Nm9V74iqdYDFyZwMLGwgOGnmghXNT5lAvkazM3oPgRlzOU3kBQMNJKMKWtzkws ZatO7SnXXoLC90BYBdzQ4WBYmqP0ctRk/0Hc+tF1GdsKEFAQeyvKQs86n+DiFjeYhpmk XRCMyCpcHGCSuZBRElORlA2grjvaFnRdFuAQT1Yla1Xs8yZi7vEIkUka7t7lT4f5IA/C Nz/zbna6jWOHljpIWs1q8ROPrfRJMrX036XcNg8uGpFIBpPpSv0XdZ4EIxr1ptLpLNuX DVDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689137333; x=1691729333; 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=NbIXLhGcv55DRN+tdgUF1RDQaXbW3R1iWR+8p4hRVQpmLqedYByNgzUIGf+EJvA/15 iUv8ehpim6Mp26bDUSizoyZwLVeVpnhQ6tcpgxqPExuqHK6oQYgHxVJAL6ZDqL5llzg8 uLfh72bA+3dFwQJN5FMN29JbMrVFu80xGw0kiCoSBAVgrd5h/ti4Go6Dxksm0v9vuMmx 8uMB4tybOZnSpQcqD1splNKlvMVU1RTHNtJe67+DepfhcFxOR/iLSAJz+SZ2CgXTB5jQ 8m3aMCovMTZgP1LF1W5MfzqqifsFY6utYL8TXO3s+bzPum+Zm7t6iebnHNHJpZTfXhgC XDcg== X-Gm-Message-State: ABy/qLa/OCLP8pU0kzlQGKiBzpWq7oJEetgiGAit66jpYaLpMhVRrWyh bqLq0zJB4RX18ymy1TitKDUNhA== 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-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771190597143784231 X-GMAIL-MSGID: 1771192297262385736 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);