From patchwork Wed Nov 27 11:43:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13886908 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 4FC46D6ACC2 for ; Wed, 27 Nov 2024 11:43:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 608CE6B0082; Wed, 27 Nov 2024 06:43:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B9316B0083; Wed, 27 Nov 2024 06:43:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 480AD6B0085; Wed, 27 Nov 2024 06:43:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2A6356B0082 for ; Wed, 27 Nov 2024 06:43:29 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C11FF1415FF for ; Wed, 27 Nov 2024 11:43:28 +0000 (UTC) X-FDA: 82831689486.06.D9C6BD7 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf14.hostedemail.com (Postfix) with ESMTP id CAFEC100004 for ; Wed, 27 Nov 2024 11:43:20 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="j/uSvKIa"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732707804; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=WpTl1AZ/OqekkI9tTrE3BFW5L2tAMKrlalQMvkuddqA=; b=PIIYLWb+4mUa5WimMeux1XmEeIw1/u7dsoQp4coFI6auxYgcjLvw2a2DOZ/hJCSywDvif6 flsWS0qdgMNeoFM7YEKHiTyEebc9h1BfO7fvzQGbYwxkt8z64rlSRo9zSGDh0IQKvDD5XJ i4Qszz2bsxWcizvq7JtG9uyZiWoWw5U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732707804; a=rsa-sha256; cv=none; b=GlNLOIaja2N6EhJcn+0e/RQ4T9WNpw8pV695e7tH3favaMQhHtgxH6tuX2vqYpzjIlGslP /wMOvQXId2haA9VAu05S4VH47E6UGTs3KEk2nmeeIq69URSAIn+AsnhURIkpAbP8yyU0Wn EXdWCzi8EXby48x1pM1FBMGhdL1a8og= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="j/uSvKIa"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aa535eed875so640441366b.3 for ; Wed, 27 Nov 2024 03:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732707805; x=1733312605; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WpTl1AZ/OqekkI9tTrE3BFW5L2tAMKrlalQMvkuddqA=; b=j/uSvKIaXEV97+3QCpgJ0wRfFG/kshLIttPdlZ02A5czh2Cy0CfVT8H1AtogT3/sFo n/YmyVrePIhx+K8F5nvSYbs6BIHQ+YZwhSbwi1HxcVjYmQcomo3FFBx+sd5gHb9114JB jspYf+AUy73MWiQCSr6W6qzaXkuQ0cC5vUjgR+hJ+SfJvv7lG6Z4NQC5r5uEmahfpk1J a3Ak9nwAsKFVTJcLa4oUhAfNYi6l1WJH3XErJnVkKjPsvMcmPqxehDogahhjCHe/iqxS JooyMyRbGC2c/19/Yk7BTGHyj7nEAfPiBDsJbIqwf5xSQ5681aRhT6D/itD+papGYoY8 Le8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732707805; x=1733312605; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WpTl1AZ/OqekkI9tTrE3BFW5L2tAMKrlalQMvkuddqA=; b=v44fjkZZRDG21GzcS3wAEnly7q78Lc82FguhQJfeVdO+ZTTUo4hceYayTcrJdFSW4O iQzDQIHLADlk8xZPZgKWb2Hxr/UPMF7sutR5WEomx+KbgD06r1kGg/ZSBlFEKFyAsF9E kglEV+L/ph8b8JFGCmmogXkKZy9inU8QNjAA7Y/XPpx5OT+n99s6anVmwqeskZ5Go/Wl ANjcpHVmAeFZeuyBHk3dv/XF1SY90OqYfBMdTcSd32Lb1O75Vj0cMnpECS7xmp7L/EEb jRVcPC88qKNtNwvdo8O8SVL5GXMCBj9cV7oFEItkZ79W8NIPoAenFrkt8ySzRA6Bh0C/ oiHg== X-Gm-Message-State: AOJu0YwyRNnU7oLhTZZeW7XYZSqEqkEwbgZj/efhFKSWR+QPvaHEag7Z NQ84nkm7sa3FLVZ30kPWV68rWMmWBgNneTyFh0eGwjD/63xb7Lo3 X-Gm-Gg: ASbGnctmkyXURuNYWYlWEXl2UC/0X3+n65JAPsMkU7QK8fxE+ZLtSCe1gBL922oJ2Rc bmAmQn0XQb4OW64dZaYPW3ypoDhT9BSMOF2rAY7KDURRSBXdFHLzwKphDqSusj9CZVL0JAypNih xg1EvqcMUyHBvuWR5IwChHpo3lrRMW1/upeuVf3hCmEOEcPVCeScVif5u0Qm7l9AHZln1TXSqSz asgTutZBY0SF8SMpn9uW+F/q2XivgcKGt5H8691kgrH5ohWiA== X-Google-Smtp-Source: AGHT+IGvCVJigs5dtmdQmqY7iJG2qyAqb+68zwhkD77JumZKUqcZgaXUH4YGYrfHKijtoUaMpbzL7w== X-Received: by 2002:a17:907:6ea1:b0:a99:6791:5449 with SMTP id a640c23a62f3a-aa581081af5mr182841066b.52.1732707805177; Wed, 27 Nov 2024 03:43:25 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa50b28f848sm691147666b.36.2024.11.27.03.43.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Nov 2024 03:43:24 -0800 (PST) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com, vbabka@suse.cz, jannh@google.com Cc: linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" Subject: [PATCH] mm/vma: next is already retrieved Date: Wed, 27 Nov 2024 11:43:02 +0000 Message-Id: <20241127114302.9650-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Stat-Signature: 6dkmiyjwgdsxa3344o4qrd17mfud6a9y X-Rspamd-Queue-Id: CAFEC100004 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1732707800-900007 X-HE-Meta: U2FsdGVkX1+HeBjxWK8XVHY2c2QhJE25AsAxcX5NUQbtzJqaQy2h5tM48Z9SS3c8W9Frm0GCFVWklIW53+FMYw1/WBAqrbTEz30wKVIBQsWacfGugbkxo9EqGgDYO9jfS76Gv6IUz9I/ylLRFbcEV9CnLrFNGU/NQvmFLMzIDJqqn7wzp7ANuE1OvvjCUu76ROH5Ejdo8lPvYthFaA4rEh7OEZ/r0nbj4MTHfH1fEVdUy6HYaugEkjBes8DUZBg98YupG2OZ2otovwC3z6R3E/SAFHmr+cAd3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xUbYnIX9pQrjwwCzf6/NtmVHsKYnLb/zr/3aBKFAOx5FNGAV6YBLq1EH8GtEKkcxUdx5+pBVpGmz06VC3sWfd7N5oGQp3UcrdsZ/5a6QIs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: vma_iter_next_rewind() here gets next vma and rewind iterator. Actually the next vma is already been retrieved to new_vma. Since the iterator is initialized to addr, we don't need to adjust it. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Lorenzo Stoakes CC: Vlastimil Babka CC: Jann Horn --- mm/vma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vma.c b/mm/vma.c index 8a454a7bbc80..d419e3700fa7 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -1727,7 +1727,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, vmg.vma = NULL; /* New VMA range. */ vmg.pgoff = pgoff; - vmg.next = vma_iter_next_rewind(&vmi, NULL); + vmg.next = new_vma; new_vma = vma_merge_new_range(&vmg); if (new_vma) {