From patchwork Wed May 4 00:39:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 12836603 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 858F9C433F5 for ; Wed, 4 May 2022 00:40:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFD976B0073; Tue, 3 May 2022 20:40:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DBCF06B0074; Tue, 3 May 2022 20:40:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5D486B0075; Tue, 3 May 2022 20:40:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B72456B0073 for ; Tue, 3 May 2022 20:40:09 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 98978292A1 for ; Wed, 4 May 2022 00:40:09 +0000 (UTC) X-FDA: 79426203738.23.94F9D94 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf21.hostedemail.com (Postfix) with ESMTP id E6EED1C0094 for ; Wed, 4 May 2022 00:40:03 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id y21so71375edo.2 for ; Tue, 03 May 2022 17:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oFox5Dj1JzhvNG8FV4woU3BY71fSczkL8n3MJysaQuw=; b=BadZhIYHAbsoPz6gR+TUu0F3MP+sm9CgIOvdAoQewAq1eNX/cYyqdZSB5KaAuhmBA9 SzTXB9Px7bnL0zwPNidJhG+QwSXtadoOJsLH8VqYVGcoYBF5uf/eappU8nq8I2Sf5oCv uWocjJyGwbnicyD8aGSlIWWXGwtYxzR7t6Zy6/2K2TqWPf54iXvNoBui8uTwgL6BfZ/0 w/Bsci7fELS04fgWoduTShzgHgTZ685fVKoKbsZ6ALlF/nmS9/R/rsWxYauwOPkBJ4eT TJPpKEaABSX5vawgNDbHCQmE15BC+vtNlSBp3YFD24RWuziylgc6GS0UJC+otmj1lAwf Q5oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oFox5Dj1JzhvNG8FV4woU3BY71fSczkL8n3MJysaQuw=; b=dwHjd8dTKCfy4UPtyXTuZnZa39bxsifC5x219hkE+GA8KcqdtmPO/UfgQskrkX8QJJ xP0gUuaclKAAZ9mNJbTyYgY8dMK+MhhcowZhzVcVKVWuVZ4wmuB0gccZJR7FYyeS8SVN sMI7sfN4VezAYY1yMNAa/8FPGmleb9/H3xiFyTlKGLY7CXnwXmc/eqwSm+gEFljttlic HmT7OHTFdR6xAK9vHYzx2ryAXMIgwAcms/ovKo/SBciNSm7HRHlIHfhdBuExT9SjOkzp lrdKzlfpxLlqh9AhPjgNFYFihRdZ1Savho5jEIRF0vWCKhScs/rhnZStJoPRGD1J/c5B kzJg== X-Gm-Message-State: AOAM5300PgExQvzo7azWBdVkf2kHiWriCp0Fp2gr5zAkLlGvYz6NPaIF Dg58ShYWLmbYtoRSXNmSC/g= X-Google-Smtp-Source: ABdhPJzLYtaqlkm+Rfz3GZYMtJBCEiRaMh3Q5JLUM8gKlGNRWqU79rrWv9dxUbftEk4P83HPtVn/xA== X-Received: by 2002:a05:6402:4301:b0:427:c8e4:4acd with SMTP id m1-20020a056402430100b00427c8e44acdmr12620121edc.230.1651624807881; Tue, 03 May 2022 17:40:07 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id hg1-20020a1709072cc100b006f3ef214e72sm5082504ejc.216.2022.05.03.17.40.07 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 May 2022 17:40:07 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH 2/2] mm/mlock: start is always smaller then vm_end Date: Wed, 4 May 2022 00:39:58 +0000 Message-Id: <20220504003958.18402-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20220504003958.18402-1-richard.weiyang@gmail.com> References: <20220504003958.18402-1-richard.weiyang@gmail.com> Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BadZhIYH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E6EED1C0094 X-Rspam-User: X-Stat-Signature: d1gcnzkc3izy66zb3wgqs7anqerqm45s X-HE-Tag: 1651624803-728954 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000074, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We would meet this situation in the loop since: * find_vma() would return a vma meets vm_end > start. * the following vma->vm_end is growing So this situation never happens. Signed-off-by: Wei Yang --- mm/mlock.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/mlock.c b/mm/mlock.c index 0b7cf7d60922..eab3b0a5b569 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -505,8 +505,6 @@ static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm, mm = current->mm; for (vma = find_vma(mm, start); vma ; vma = vma->vm_next) { - if (start >= vma->vm_end) - continue; if (start + len <= vma->vm_start) break; if (vma->vm_flags & VM_LOCKED) {