Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp69843lqt; Wed, 5 Jun 2024 17:51:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZT59b1y9Q+uFTYs+5S6E4ZVe8nUPs67tfk+hhYu7jZnOv0dGZDRV0J+o/0lK5uouqJrOggDyQQMOkGGXfKFpSyMqvgdcFFX3XKCmt6Q== X-Google-Smtp-Source: AGHT+IHxzh/jdpsHq+RFJH5w5jHaT6u0osgEum6zug2RtHhEepyQc0Ctq9MnQP4GuAOkXxw1myLW X-Received: by 2002:a05:6a00:b4b:b0:702:8b18:9fc3 with SMTP id d2e1a72fcca58-703e599dbf1mr4685119b3a.15.1717635111164; Wed, 05 Jun 2024 17:51:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717635111; cv=pass; d=google.com; s=arc-20160816; b=BGW1rVMP0JFs4orsVGqNWXgyLilJwBIymawzV6dT7t0J3NM4c0ZhWO3/MO8P5iW4BQ nUZNYYSJunNGKUDqZxxvXKANnUsKQJJ8WAus5Wtllz01l7MT2LxqKOytYLQI6MkHcxcp tUdGvXNZtG6xRzNJEKb2P8E8wzTacjRXihUQ+qY2mVDoQ3aYX93IfKAJYHvknK8fM9rH l49UIJ3lG2en6rnVeVSIxW5xUXhkh1NaktyJFrGLC4yrucHvRmqKZ5ENLhe/Yuxy8NWQ NmxEF4Gb85XJV6i7nx3iJ4aqZ4dTC0NGk9ZttH4d2n+jMyd+gpNMHXx8orueRqrg5A5j NZRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=f+cCaO4GQQZF5arDTs75VRTDY7XKwvZ01IHsyj7Khdo=; fh=HvM9epky9NUt4KqgMfHr1VPyLd6gnFfaBkdamINb5PE=; b=cfo9yNIq0+WlcgHbEuGtfC4dRyq5E3Gpp9Jcr8VxntkxqBj30GeUtCki7OMpmUoXeK PWOpEsTKXYhB22Se7y/v8j3MXErLExBn/54r1toAUqck17ylx+eDt4C5NvLXUj8wIULN YIBBksQAuN1ftMBBQ2vZjDtIwOXEVgJHo63uyWCF0L76xyEEuGyz2gAZpoLZIrOpGtB2 88JF0rfefUcH0fd1G4hF5CqTFzDGYzheoijr7gsdsyZNkXj9/w9rbnxP08PuQJlNylgb YLv8w2ymCm8Rr39lk6pV7X8krNxzBK7G2Ww7gF99ZU/MZQBBhF/4u5X5xBfskxOaFICT vFgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gE0iGXVi; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd3af1d9si182490b3a.125.2024.06.05.17.51.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 17:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gE0iGXVi; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 402C2286ACA for ; Thu, 6 Jun 2024 00:51:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06651F9D6; Thu, 6 Jun 2024 00:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gE0iGXVi" Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA18BDF49 for ; Thu, 6 Jun 2024 00:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717635081; cv=none; b=Hq1Ne9S1jrTuyTf0ZGuCo/s0EH2MpfCV07EvqCSAigiAiHQp3r7T/FBpjz9cRVP4pXJGmB/ycd7vtAu+McpBrFdEM0xwm6y7Bb77SGgvoWPEzV6Jpg233QGfg+v3NRTEC+YDFlnW+zw6sJlpVGuwWtasAuBg0I8YsLNB9MyZj0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717635081; c=relaxed/simple; bh=GRqVKXcsJh/sEtGC6AlRPdUI8v4SOfb2fFYrbfnYbr0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bhJ2uGhG5tJm2XqGnij/BrvxizDWZg6A0rU3B9g1H+6j8K951b5F02iU7FRkTsSk4WpTYErmIXmKV+NQA2u/q6ae1QiT8nxsZJoJYcuKNNG5FPAp7zRjMdgVvl3Jxew92H8ecAYftJLvxjl6blFNX3pjd/WXazFUIT3FjT6xPbg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gE0iGXVi; arc=none smtp.client-ip=209.85.219.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-dfa7ab78ef2so528979276.0 for ; Wed, 05 Jun 2024 17:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717635078; x=1718239878; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=f+cCaO4GQQZF5arDTs75VRTDY7XKwvZ01IHsyj7Khdo=; b=gE0iGXVi06pe7FuR0QhaavH2O6oTriEmOVhdj9nmPi2LFrn1e7uyV7YsG0HFqo/q5w dOgtnz6n73PZdKTV0YJ/L+3/JdlVGwSa8vHCMfrNY5uhXbarraI0uNj7gGBeXeEWpgDd t4xGH8vO6rUKLBW2qaT9FxOrMKGzWXewS5QNgiCO2VAlCEq4vbnzE8C8pSlkJSwnZN7+ 2w72rZgrwJKfI0LOSR0T5gNcdopW707BI8o5Sws605q/ZzbJEznx5UFD1pA4GXVJtl2Y IFkXX+cyW9IdYpxOKBfuyI0yYfXzYzXQUsyPIyPZARBcuzGWT6G+FMZBiF8wzGtm1DKU HlRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717635078; x=1718239878; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f+cCaO4GQQZF5arDTs75VRTDY7XKwvZ01IHsyj7Khdo=; b=PoRZN2YUv7ONcWWU4o3UkeHeK7/22cKslaMy9CpiL1VGXFYu4yJpn/XioYjg8xgNJC 6hj4jc4r25susPWebFH6/4lOR0wfpYYzHaZurKCUPqc7c/Ln7JBbeleIp8VnymcfZpxf wzUFHkxNgzhNSjHOB+OAwa2SbAIMbTMETikzURUJJXeyAq2MGLQBllIgDUN2+hYchfv2 7TvBJPE3EqzCiyHdzeyoJiWYJ6n3Y71dleBvi6gsSqZFlpuMjkOU5CnlJh1rvXRlbjkA wYx9DID9aTwdad83KsjULjf+eT+f5A1ADeD/0bPUPeIkSL8gazZEaG+paSbWmhWMko60 TJJg== X-Forwarded-Encrypted: i=1; AJvYcCUR5TgGAEjxHHUdL+Fmxegf02CkLUshdJFUM3H9/NvS/6zdN0sGtPt7ZLHG7mkQfmzO+w4Kz0i+oDV5ru73mwuUCWGt0AmHTC1BQSob X-Gm-Message-State: AOJu0YyBbxBnWz5rJZsfS2SqkZoUWJI0T1oUm4KOnDr6BppOSwWi7mms 37/MSlF2gGQ/D4rhYoIczkR6CDBKzOhsBuJiCFIJkvm6RCgG3FJtyG8nsDzJN4eQ/vKTEoJGw1x doPHjM0zlqi8hfNatFZClpeTwP1lkAXut71Ey X-Received: by 2002:a05:6902:4c4:b0:dfa:e131:2a8e with SMTP id 3f1490d57ef6-dfae1313607mr704141276.47.1717635078316; Wed, 05 Jun 2024 17:51:18 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240531163217.1584450-1-Liam.Howlett@oracle.com> <20240531163217.1584450-2-Liam.Howlett@oracle.com> In-Reply-To: <20240531163217.1584450-2-Liam.Howlett@oracle.com> From: Suren Baghdasaryan Date: Wed, 5 Jun 2024 17:51:05 -0700 Message-ID: Subject: Re: [RFC PATCH 1/5] mm/mmap: Correctly position vma_iterator in __split_vma() To: "Liam R. Howlett" Cc: Andrii Nakryiko , Vlastimil Babka , sidhartha.kumar@oracle.com, Matthew Wilcox , Lorenzo Stoakes , linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2024 at 9:33=E2=80=AFAM Liam R. Howlett wrote: > > The vma iterator may be left pointing to the newly created vma. This > happens when inserting the new vma at the end of the old vma > (!new_below). > > The incorrect position in the vma iterator is not exposed currently > since the vma iterator is repositioned in the munmap path and is not > reused in any of the other paths. > > This has limited impact in the current code, but is required for future > changes. > > Fixes: b2b3b886738f ("mm: don't use __vma_adjust() in __split_vma()") > Signed-off-by: Liam R. Howlett > --- > mm/mmap.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/mmap.c b/mm/mmap.c > index 83b4682ec85c..31d464e6a656 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -2442,6 +2442,9 @@ static int __split_vma(struct vma_iterator *vmi, st= ruct vm_area_struct *vma, > /* Success. */ > if (new_below) > vma_next(vmi); > + else > + vma_prev(vmi); > + IIUC the goal is to always point vmi to the old (original) vma? If so, then change LGTM. Reviewed-by: Suren Baghdasaryan > return 0; > > out_free_mpol: > -- > 2.43.0 >