From patchwork Wed Mar 1 02:27:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13155455 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 9C59AC64EC7 for ; Wed, 1 Mar 2023 02:27:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EE886B0073; Tue, 28 Feb 2023 21:27:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09EF66B007B; Tue, 28 Feb 2023 21:27:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA7ED6B007D; Tue, 28 Feb 2023 21:27:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DB8166B0073 for ; Tue, 28 Feb 2023 21:27:26 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AC6D51202A1 for ; Wed, 1 Mar 2023 02:27:26 +0000 (UTC) X-FDA: 80518742892.03.D652394 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf01.hostedemail.com (Postfix) with ESMTP id 0933540010 for ; Wed, 1 Mar 2023 02:27:24 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=jwkVCM8M; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of 3DLj-YwYKCJ0PROBK8DLLDIB.9LJIFKRU-JJHS79H.LOD@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3DLj-YwYKCJ0PROBK8DLLDIB.9LJIFKRU-JJHS79H.LOD@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677637645; 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: references:dkim-signature; bh=d/02ba9pKPs+xaeDNoqwdk3OeXtfhs3eb+vbTt5q+ds=; b=6zsBoMYpw8Pz/VraALmXGQnYIizb7wIO0qcoSeTDILhGEs0CJlCTTssvs+oTuW/qsUzpn8 4lpvrVlSIeNaDA20954sid9hVn/pU9xKS1OrvicaaQnOhk5novrrstSaAec+zk3UNk2jEq BNiXXlvTJ52bMMsJZSbvhFbhnntXtC0= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=jwkVCM8M; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of 3DLj-YwYKCJ0PROBK8DLLDIB.9LJIFKRU-JJHS79H.LOD@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3DLj-YwYKCJ0PROBK8DLLDIB.9LJIFKRU-JJHS79H.LOD@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677637645; a=rsa-sha256; cv=none; b=UC/ZHE651AIEfSTPfiE26xVwM17RcJYTcidigQ9MrvySd6A7yFwI22XzQ5inxYwFN5wrKZ JwvjNC3jt3SFZHhAOxxh8gLVxLbE52FAdZBUcwop0/mBGzGI/UFkU4NVYDvybnXqGfWWvL aQbfkyieR/OUM4DKWkgKK2Ia/okDUpk= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-5376fa4106eso252889427b3.7 for ; Tue, 28 Feb 2023 18:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677637644; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=d/02ba9pKPs+xaeDNoqwdk3OeXtfhs3eb+vbTt5q+ds=; b=jwkVCM8M/VdQLhfCkuQxzR9SFY68aOcPkmEc06SJ6jbXq0SL8vhpoeNFFcc2FIMX4Z qOAOI7yp7551oLwvyh9mgMAkw383CXCX5b/h08MQxyDTWLFQM302VK4PCxZW4njJU5wA w8EcBp5F7o/S81X59PWPM2wdZuE0ddMRfvLTZfdeoGxlABs9nXf5/tfjdeYbhTyrLwWT e+FKJlhxrRgP+4+FF7t+gW+oCtxdSoeGJUiUlZqGApiO7FNDs2PJNRAhZDwX5gfdv5E5 1eq6ilJ6KGu4P83kvjayRhSH9oLzyJQNHlvbOeaMFbtv/Mp7aqikHM/ZQ07xCIiTbr5t l13g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677637644; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=d/02ba9pKPs+xaeDNoqwdk3OeXtfhs3eb+vbTt5q+ds=; b=dAI5eE2LZxEGaP3otaxu/fy6HNl+YmF/xQwXNPCLbfjZVPlIh7MkGNNMjyWIpYUWlg bjoAlY3Q6U9uJU7jm/3XNtsCJwvfYquzprNTYcTSZk/RgJfNTlO9/QdcPbC+xSfdGAN2 K7S5tTFybxbxa4fTnN9OL0TKX0B0R/x7GuwMUJRA1eXONZY/7pCi0zlRIiTz2n9SD+m5 WPkwy0PB+JbbFMp5Z/W61xTtm4yjCIAQ9kKLdtXwrEMhs543SwWOi7oo16EtamJCx4LG GuoVJ8OGp0vGT6t4aafBUifmwimhtLg8C8+4aF8nq/zJ/e9FsPoq86Rkjop5IcWrpetb NUtA== X-Gm-Message-State: AO0yUKXov6wzN/rTj1CtkINNYstPVwpAMgNxmXxCe1xvNdKceplUZOoX F8PTJfdacY4PFfE2f/rM8QzQGHP+JcA= X-Google-Smtp-Source: AK7set+61/MW3yRA90mpctcsE10D/EizwukiJmPOyOpLJRZveGe/foy6L1qBI9eSafdW1SJNmwf3gt5vepg= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:612b:820a:2225:ad82]) (user=surenb job=sendgmr) by 2002:a05:6902:50e:b0:967:f8b2:7a42 with SMTP id x14-20020a056902050e00b00967f8b27a42mr2156872ybs.7.1677637644274; Tue, 28 Feb 2023 18:27:24 -0800 (PST) Date: Tue, 28 Feb 2023 18:27:19 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog Message-ID: <20230301022720.1380780-1-surenb@google.com> Subject: [PATCH 1/2] mm/mmap: remove unnecessary vp->vma check in vma_prepare From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: sfr@canb.auug.org.au, error27@gmail.com, willy@infradead.org, david@redhat.com, Liam.Howlett@oracle.com, jgg@ziepe.ca, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, mathieu.desnoyers@efficios.com, pasha.tatashin@soleen.com, laurent.dufour@fr.ibm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, surenb@google.com, kernel test robot X-Rspamd-Queue-Id: 0933540010 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 7u6qr117ti7gg9wmu9mnan1iadyszao6 X-HE-Tag: 1677637644-554815 X-HE-Meta: U2FsdGVkX1/oELQ2OfcoB1inAJOTSsqaFBZrV/sj0IBLCV3G9l4M3tPQdNa1XITah1L7tCGSku6wjP/Hu+ggm85RQh+CJr4LXeABAeGpGJUlK2WMfCPddodIGY0zstXqyXi+DPS4K4s+18M1lvidBmfcIBSpsomQn9My7cGD1nq9rHqpdFZCPOsn25XjDYpHsW8rdKGM2U6PCqBl7oWUk13G94ob9OYJqMwnjwHYR2rwPemFBxNA9l+arOGaoIZ3jY1yQfpzOEgpbv5w7KectIGHelvA3+NnQi+soj6wgVjNv0F7LjV3KlphH9Pm+ZUukGJNuEIfsY+MIe+BU4gKRm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PMTKmOirvrq3cnmu3d0UvQZGZfBS1lhh7ft7p8BDzPEt8TGaD8zeXySsDfv2W0oPO0VpJiS/YSWQS3WK6qV8HdhfhRvd6Jz1eGv9/r52mJdvIk1SvyVQEI/fOEzq9NAnumqgI3jMNKTZPGYr2l4dOvGLvYxwE/vq5LKa2bfqgJcQtWlUScGYnLv94q23jAWtau4JMOuLD4rcEal+57QqS8VDg7wl105EHLAgNigiKxUDMxZMJCHc6vUlvgYmuU/E51C4cLcq3isOW+RmFrOwgCsIrsLcfho1NbsvdIDQ8hE9R2VCZr2DdxcMW4WfuPpZac79aB3BqspYSoa9jjmoMGEFRhZcXZqecZZG3vYELhw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: vp->vma in vma_prepare() is always non-NULL, therefore checking it is not necessary. Remove the extra check. Fixes: e8f071350ea5 ("mm/mmap: write-lock VMAs in vma_prepare before modifying them") Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/202302281802.J93Nma7q-lkp@intel.com/ Signed-off-by: Suren Baghdasaryan Reviewed-by: David Hildenbrand Reviewed-by: Liam R. Howlett --- Fix cleanly apply over mm-unstable, SHA in "Fixes" is from that tree. mm/mmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 0cd3714c2182..0759d53b470c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -505,8 +505,7 @@ static inline void init_vma_prep(struct vma_prepare *vp, */ static inline void vma_prepare(struct vma_prepare *vp) { - if (vp->vma) - vma_start_write(vp->vma); + vma_start_write(vp->vma); if (vp->adj_next) vma_start_write(vp->adj_next); /* vp->insert is always a newly created VMA, no need for locking */