From patchwork Thu Apr 8 03:35:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gonzalo Matias Juarez Tello X-Patchwork-Id: 12189893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50B4FC433ED for ; Thu, 8 Apr 2021 03:36:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F096C6103D for ; Thu, 8 Apr 2021 03:36:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F096C6103D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 80DCF6B0080; Wed, 7 Apr 2021 23:36:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BE576B0081; Wed, 7 Apr 2021 23:36:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65E8C6B0082; Wed, 7 Apr 2021 23:36:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 46CAD6B0080 for ; Wed, 7 Apr 2021 23:36:03 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 062764404 for ; Thu, 8 Apr 2021 03:36:03 +0000 (UTC) X-FDA: 78007786206.36.3EE2FC2 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf21.hostedemail.com (Postfix) with ESMTP id CF989E000108 for ; Thu, 8 Apr 2021 03:36:01 +0000 (UTC) Received: by mail-qk1-f180.google.com with SMTP id q3so849147qkq.12 for ; Wed, 07 Apr 2021 20:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=AEhzM8H87TLEc6j+l2DwTwvWX989gq+ctRvsxTktPlE=; b=iPCemFQxN2pjdzvxvUmYLnZawwXoWupp+3MYQDwLQ+GJLmKuZBLXk9wBfiA4AAwXNn PpCxrfy4g/MwbHCrH7ew93AGMFZiL6YKawZsi1JMDM/23O76+MeFXUHXROtsdkyT4H6N Crq2rX9MozmWGrh7bDfPATgoYj06ydCshXJl/RclxvJTg3l9ilQ2rFHb2Hl3u63zsznb waDCq1Blxah09rXZJ/Tp8/PG/qsCVJ/wFBrDebpm6Spvq10ALsZt+zWcxRrlHrr0XOtZ p/Ztz2wwnsS+gVXK5834QewJnwu1XcepZxipK3UNd6AZOfpiIsz/8aZBfpw7rtz0jOgt jx7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=AEhzM8H87TLEc6j+l2DwTwvWX989gq+ctRvsxTktPlE=; b=fFe5JpDEVkRUsHiVW9uSegCcS5P+O6EeWaW+JNIeDW1d+v/NjK0teVUWzJYMxxWKPJ PLn1v6nLu7v9fry4OIPh2mFYKuQK+QFykOQo3nS8qBh6/cucf3pwTlCE2+AO2LCzt791 yYbrGvmqcgkAvyNbMJ9OcMNBRw682vbAehQ2R6Mb9WW0+EGNEpqnoyu7CYywAN+MHDcz VUak5Fnrr56nGQ8MO1NQi8m9eTPjGWF8psjJ/8Gsao6zZWWo3c713H4a6BUAYlDBohnz M8v9iCWkMgZu5IN+w+mSU+NfxWNa6wWVbpFmKqPei0QitLNE3Tpe3Y23X4KLM+oyo3E3 v3cg== X-Gm-Message-State: AOAM531sa1eYLHCkoh+irU6PSf4Av/rmZIgqbHkEkKGSBR9bJfFITUe3 NExalwXh2sr4TMoGnrCOgg8= X-Google-Smtp-Source: ABdhPJz4RQ3njWBFRCh3MJa1CARIPDaCShvxTLkKLtJ9KSRcTM6tLEEDMFpdEZdxEFI+NsJOGLpEzg== X-Received: by 2002:a37:6104:: with SMTP id v4mr6462246qkb.429.1617852962063; Wed, 07 Apr 2021 20:36:02 -0700 (PDT) Received: from monty ([192.141.93.162]) by smtp.gmail.com with ESMTPSA id z6sm68085qkc.73.2021.04.07.20.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 20:36:01 -0700 (PDT) Date: Thu, 8 Apr 2021 00:35:48 -0300 From: Gonzalo Matias Juarez Tello To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/mmap.c: lines in __do_munmap repeat logic of inlined find_vma_intersection Message-ID: <20210408033548.krdk4xneump6a7d3@monty> MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CF989E000108 X-Stat-Signature: e754zgexng48odk6ubfmieyi18f9qb8w Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=mail-qk1-f180.google.com; client-ip=209.85.222.180 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617852961-237980 X-Bogosity: Ham, tests=bogofilter, spamicity=0.302557, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Some lines in __do_munmap used the same logic as find_vma_intersection (which is inlined) instead of directly using that function. Signed-off-by: Gonzalo Matias Juarez Tello --- mm/mmap.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 3f287599a7a3..1b29f8bf8344 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2823,15 +2823,10 @@ int __do_munmap(struct mm_struct *mm, unsigned long start, size_t len, arch_unmap(mm, start, end); /* Find the first overlapping VMA */ - vma = find_vma(mm, start); + vma = find_vma_intersecion(mm, start, end); if (!vma) return 0; prev = vma->vm_prev; - /* we have start < vma->vm_end */ - - /* if it doesn't overlap, we have nothing.. */ - if (vma->vm_start >= end) - return 0; /* * If we need to split any vma, do it now to save pain later.