Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7456152rwd; Tue, 20 Jun 2023 01:14:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4UrDUyi9sF2Jl3QNOpmg37mhlo779StOtv3sTD10OLH1SjmKvqWHCivVs2h9LY+FU7uUUb X-Received: by 2002:a05:6a20:394d:b0:122:2bc1:8855 with SMTP id r13-20020a056a20394d00b001222bc18855mr2772464pzg.10.1687248881028; Tue, 20 Jun 2023 01:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687248881; cv=none; d=google.com; s=arc-20160816; b=aVe/zhaZPxEkSVhu9L8SznFt7kG3puN7DsLVObq/5AK0uyvp8EtK74oLz6KeIYC0A+ l1XQL3smtRful2EJFyDjIA2sUfUBX5v6pLL0Rev9jvQF5apwrzi9wGgLfcMJJjPkw+Pk FTMsIryUraMA1+AcaGIdGTFLjYvwRLnRfakxfBYWuWdOoYhwb4H68grNFcGnJx9IkiFy cs4LyIiicz7cJcUXsvxZkl5cs9zZjXvy7h3v9nRyavBiT/omJDDFwzWtrG/VeAyVwgi3 zvQqLGgIVu5Tz8UKznjPQDFhSwGsAqlV5GDL1ZKJfNeF0aYSwrMRm/X+PZQKZnL+vYEH JJTg== 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=Aa5HWe45UW6rQUJiJNVLC4MPu6AngULI5k321Sbm9Ew=; b=wcjDZssgLvsd1ngBNfptWEMj7Mu3ejP0mxwDXS/B/UaGItzG52WqzTg/AMGXL1/vzY jkv9SNZsIPLpJzqDZQ6OHetj0CuyU8C9LIkPeVQKMqYS4jdqYt6Vthd9o/oBQlMtmJFS LttyJlB1GBNgEetlIMLpfCnhcfnfyTRi0/BkrPOVQa9ZHQzqez8UdvvT7e/d1qxwv07B S6qE9ibYhjumyxCTSvffqyPaTI0/2G4cD4caREyhJO8NnIVqRbLq83YY0ED2hiBjh8lb SRSHGSEp+oZ+uol69wvo8cZ/cHtcnfu76QYc9LKr5vIi7LQnDRwgYtF4Dnh9gYbvjarT sZzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=PTqSZx2n; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a637011000000b0054fd9e9b862si1247185pgc.232.2023.06.20.01.14.26; Tue, 20 Jun 2023 01:14:40 -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=PTqSZx2n; 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 S231753AbjFTIAw (ORCPT + 99 others); Tue, 20 Jun 2023 04:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231985AbjFTIAT (ORCPT ); Tue, 20 Jun 2023 04:00:19 -0400 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAA4F19AE for ; Tue, 20 Jun 2023 00:59:55 -0700 (PDT) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-5700b37da3fso39520867b3.1 for ; Tue, 20 Jun 2023 00:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687247995; x=1689839995; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=Aa5HWe45UW6rQUJiJNVLC4MPu6AngULI5k321Sbm9Ew=; b=PTqSZx2nNI4PV4JwXAt99NVosmlLWlQ/KYn1Uf1f3Yd1Z3NVe7obF1sAci/vRU4j/I /dODEkNukKEVJX5QJOgx8A4SVofs7E+EBk4aUKnEe/gxIGiuFO4K0lGYei4SR6tcYKnK AduYU9eLhwRb6vByQAsUQ6tUe6SjjlibwcGiUn9EmoAEYZk/fTkwOJxts/LviFdlBYyU 2HDG5towuNEQ5CvzS8P4/0FmCn98RyYyORjokeprTYbqe1PhIQYQex8ifvvnbwDxRbO6 McJrcKmHoDDBglMt6fs5aQdKWv2A5unXxMstk7k6pfo7pQ4FA/PbwXapoPL1ZYXTeDU7 ON7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247995; x=1689839995; 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=Aa5HWe45UW6rQUJiJNVLC4MPu6AngULI5k321Sbm9Ew=; b=YHjnx/Cu8l1EhhQLx4hbiZgvRBnSGXPm5FnS9I6Kv7faln3ipixdHk4lFdhSJsyZjZ aTPLDKJygXoFGyxmP+FWVZYrrpLqgn08fqguKSrmoo1O8udI010kgvT4uSsyrNic9vZ6 Kn8OqDovTvEbd4zdOCtRuJmCHj3t+LFpSXVDSbHiWE1OYe0tqeWLrLZsh7fPwib/04Az noKZfOQmEN5t6J1UPvWAU2FCrmIFxYGrsGgX5aTnJSaiTHnGHnfDhRqwaB/YY4GT9lz1 lV6nFidDe/fH7wH7/Aj37lzVvZU2XVDQ8IdiIDQToPRBpQxlawATgGhssx+Lb2Qncx2d R+Rw== X-Gm-Message-State: AC+VfDy0cgta/aWfbMPT1Xk1Q2TjilHtG5qlVGtk0VsaEdqairTz2v3e 6p7LO+ldZUT/ELU8e33p1V3tQQ== X-Received: by 2002:a5b:bc9:0:b0:bb4:14a2:fb4a with SMTP id c9-20020a5b0bc9000000b00bb414a2fb4amr2548922ybr.9.1687247993367; Tue, 20 Jun 2023 00:59: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 v190-20020a257ac7000000b00ba88763e5b5sm268132ybc.2.2023.06.20.00.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:59:53 -0700 (PDT) Date: Tue, 20 Jun 2023 00:59:48 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Gerald Schaefer , Vasily Gorbik , 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 , Jann Horn , Vishal Moola , Vlastimil Babka , 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 v2 12/12] mm: delete mmap_write_trylock() and vma_try_start_write() In-Reply-To: <54cb04f-3762-987f-8294-91dafd8ebfb0@google.com> Message-ID: <27505a8-e717-61ce-ab70-5f79d9bf646b@google.com> References: <54cb04f-3762-987f-8294-91dafd8ebfb0@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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=unavailable 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 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 3c2e56980853..9b24f8fbf899 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -690,21 +690,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; @@ -730,8 +715,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); -- 2.35.3