From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 BC0DD1F2371 for ; Tue, 7 Jan 2025 18:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736275889; cv=none; b=kqcf2xVDfXii0SKTOQyi3Mr+dPTQBs2NssRGZVJt8v5dHEQCPY+zTlLZP+9S9bvIHy0tBgVsRFZAakNppSQmJUrkizSlSxkbt8eSVjXlrtxQx9oKUOhvW+tFW0RG9LyrNPTRnxJ+hSwHFSckPLtVQKxdJqvnU2hij5KN8fxzFzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736275889; c=relaxed/simple; bh=jkghxLGiHyUshv2MgUDBF4bCNwaIMw8OePw2ImjoSuE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=o83s6N8S3xFrYaT4sFfmk9tQ17x8m+pY6q1eM9ubLrmCwloA1Tb/vGLdDGDGow6+IwFo9t9X9+WMs4uX49rXVal3S4CdwOwh9eFMj7jYSUJVOotoC5f5MDkgShBPeRXm2wVeUCUull3M+ktstvC68MLZudpeG5zz+/VXVsDEs2w= 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=nuTzIhvj; arc=none smtp.client-ip=209.85.160.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nuTzIhvj" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-467abce2ef9so24181cf.0 for ; Tue, 07 Jan 2025 10:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736275886; x=1736880686; 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=tPh2gKS/v4VjzRQCsLemWsvX/hSIorRAHAy4XmYPBPU=; b=nuTzIhvj3SDEKINfEfsRBu6xR7cQLJZgzkj7aC4dJ8sfpTukpadf0zoIoPc4Y8+wr7 dJTdIYuYSMZiHBswpKs+WZWyJ7eE416oSh/L0oLRzfAXcgRJH+MghoYHYbtTB7UIjTVG ClPWmVcA80CW5NPs2/AmNMuLfa2q2ruFRhX8S9S/j3//qvYNC1fO1AeB60IArJ1B0oVe o0SNU9H3wGBst25PXLKBHjYuT/i91tu/giNqz+YpFC6yrNSeEikCalax5/wuRbNMrZml pluPKWl5SymiJqFfbHx0HayYk5vYutsJVeGjhh5R4Ugq1gj95xpfZpiymTEPu2XfR492 DmYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736275886; x=1736880686; 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=tPh2gKS/v4VjzRQCsLemWsvX/hSIorRAHAy4XmYPBPU=; b=VqrHKb2lrvotfAd3h4I1Ql/Vh7xnip7aa0jV2udPcv8mcuC/znqJXEdgXCht1INAvk f6finwDTlhd6pLDJ7GzMQA2DAYlh+U+w2H4Y55EgzzoSelhtCR4lcJlvdqsQqlt+RpMG 1cXvUPfZXsAAIYmsd+E1Hsq3Ivo+J2CusMIXPHAqVSuvvd2EO45pb2v6Ios5ji1NR7+A p5HO3hYyYWuRzCcY2t0er0YBDdMjiCcq+QV42dYVJXEhcI70JdPTUpwnoI7diWy5d8jH W8vuCy9+na8SzIKKdjc303ErW0hZBnjBy3311bhdty6DFWIC0JMthyhAHsDTzgbIaASm hEmw== X-Forwarded-Encrypted: i=1; AJvYcCW3GUil4LWB0+4kPEDV2Q1Fk7oEcZHdfJKv9+0+S9u26s/IZ2q7YLrnWjtwS0NJhZnpB0v7ErrpmovxuLw=@vger.kernel.org X-Gm-Message-State: AOJu0YxUAft0U2Yjl2j00VkMdhY+5t4kjlu2PIruEEDuGiRxbpmDbJU3 87ke1R4rfolHddcn8X/z0tH/o6FO1RrgGInqLOrqMeLU4G7lEkuVjnmmOfRMfykSeT1F66/+UX8 BEZM+cUcAmJHvdhRtuKkI/NqMuqF3RvdjZaPy X-Gm-Gg: ASbGnctu0WlbHBHqBesSXeHAcsIapLkvLyLVkBCP7pCQfFvLRORjxztsDQ4fK4xfGUb 5pvV/o7QJ9k6GJIaJXoc/GnZMMX+73raY09sV1KIpBNW5I0bmiTEIPzyuECSN/32Xr4UW X-Google-Smtp-Source: AGHT+IGvMHw6R55/7RPunW0bn5d1AcmQMp94GlSumE0j3nd2FkOFABupMFvz0IO2VbC/lpg+oAQLe5CNCvnHOkf1vRA= X-Received: by 2002:a05:622a:ca:b0:466:a3ed:bde7 with SMTP id d75a77b69052e-46c70bd562bmr18791cf.6.1736275885451; Tue, 07 Jan 2025 10:51:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241226170710.1159679-1-surenb@google.com> <20241226170710.1159679-11-surenb@google.com> <0d36fd53-b817-4bbd-ae38-af094bd301df@suse.cz> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 7 Jan 2025 10:51:14 -0800 X-Gm-Features: AbW1kvZ3qxEhcdILrDHwREO3rKuUtsZyNZvMA-zGpm4yXwrVECVYk0kyTIRjG2Y Message-ID: Subject: Re: [PATCH v7 10/17] mm: uninline the main body of vma_start_write() To: Vlastimil Babka Cc: akpm@linux-foundation.org, peterz@infradead.org, willy@infradead.org, liam.howlett@oracle.com, lorenzo.stoakes@oracle.com, mhocko@suse.com, hannes@cmpxchg.org, mjguzik@gmail.com, oliver.sang@intel.com, mgorman@techsingularity.net, david@redhat.com, peterx@redhat.com, oleg@redhat.com, dave@stgolabs.net, paulmck@kernel.org, brauner@kernel.org, dhowells@redhat.com, hdanton@sina.com, hughd@google.com, lokeshgidra@google.com, minchan@google.com, jannh@google.com, shakeel.butt@linux.dev, souravpanda@google.com, pasha.tatashin@soleen.com, klarasmodin@gmail.com, corbet@lwn.net, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 7, 2025 at 9:45=E2=80=AFAM Suren Baghdasaryan wrote: > > On Tue, Jan 7, 2025 at 9:35=E2=80=AFAM Vlastimil Babka w= rote: > > > > On 12/26/24 18:07, Suren Baghdasaryan wrote: > > > vma_start_write() is used in many places and will grow in size very s= oon. > > > It is not used in performance critical paths and uninlining it should > > > limit the future code size growth. > > > No functional changes. > > > > > > Signed-off-by: Suren Baghdasaryan > > > > Reviewed-by: Vlastimil Babka > > > > > --- a/mm/memory.c > > > +++ b/mm/memory.c > > > @@ -6328,6 +6328,20 @@ struct vm_area_struct *lock_mm_and_find_vma(st= ruct mm_struct *mm, > > > #endif > > > > > > #ifdef CONFIG_PER_VMA_LOCK > > > +void __vma_start_write(struct vm_area_struct *vma, unsigned int mm_l= ock_seq) > > > +{ > > > + down_write(&vma->vm_lock.lock); > > > + /* > > > + * We should use WRITE_ONCE() here because we can have concurre= nt reads > > > + * from the early lockless pessimistic check in vma_start_read(= ). > > > + * We don't really care about the correctness of that early che= ck, but > > > + * we should use WRITE_ONCE() for cleanliness and to keep KCSAN= happy. > > > + */ > > > + WRITE_ONCE(vma->vm_lock_seq, mm_lock_seq); > > > + up_write(&vma->vm_lock.lock); > > > +} > > > +EXPORT_SYMBOL_GPL(__vma_start_write); > > > > Do any modules need it? If not we shouldn't export. > > I'm pretty sure I added it because of the allmodconfig build failure > but let me rerun it and see which module was using it. Yeah, when building allmodconfig without this export I get: ERROR: modpost: "__vma_start_write" [fs/ext4/ext4.ko] undefined! ERROR: modpost: "__vma_start_write" [fs/cramfs/cramfs.ko] undefined! ERROR: modpost: "__vma_start_write" [fs/fuse/fuse.ko] undefined! ERROR: modpost: "__vma_start_write" [fs/orangefs/orangefs.ko] undefined! ERROR: modpost: "__vma_start_write" [fs/xfs/xfs.ko] undefined! ERROR: modpost: "__vma_start_write" [fs/erofs/erofs.ko] undefined! ERROR: modpost: "__vma_start_write" [drivers/video/fbdev/core/fb.ko] undefi= ned! ERROR: modpost: "__vma_start_write" [drivers/acpi/pfr_telemetry.ko] undefin= ed! ERROR: modpost: "__vma_start_write" [drivers/dma/idxd/idxd.ko] undefined! ERROR: modpost: "__vma_start_write" [drivers/xen/xen-gntdev.ko] undefined! > > > > > > /* > > > * Lookup and lock a VMA under RCU protection. Returned VMA is guara= nteed to be > > > * stable and not isolated. If the VMA is not found or is being modi= fied the > >