From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5B5D3BBFA7 for ; Thu, 20 Aug 2026 12:41:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787229684; cv=none; b=Qa5XBLrfPcgyn8W2oYUJS6C+/zOu/oK8L4Mw05mrEASq2fExzZMar6IbQQcQHLVMV8qduMYDH4zIyEVatA0iF+FjdR0xCYyazpuSXIzK/2RGEgmppqc6k1QdomgJgDVbSEPeoDD2uui+cBa3xEzHl1vTyezPx1puRm1kBFOP2jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787229684; c=relaxed/simple; bh=silXhjKNv0FMmjIWxv9PucIc+wCqIto9hFDyqSPdgCM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d7FOzYVAXVKEvYE/g2HYk61gxyYI+m/HknYgWzfe0bUq1iYEefea24/ZMng0o24YXhT8GDi2BBWHdaiOHGng3EgwZVssrYMJwuQUElqm5eG3HEo8i0/rggUbOlSQhkLs2BeDizYWC9tvaxyLAS7udvVFRxHYP03PUX11u1cg6Po= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SZM7xzv5; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SZM7xzv5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF131F000E9; Thu, 20 Aug 2026 12:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787229682; bh=js6jAO2AUeEOFbqOxU+HLRNThDEIhIFO+cIerREkqQs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=SZM7xzv5RyViQyk7T5ux5VHSy30/Ovpc1co4dXTt0yUMR0DGnbQL6nnkqlkMxc5v0 7eZDtdZFCdRftkOhRA7+qITeRVGi5EeKra7/7XBrweRjFW9mM8xkr3iG+4vRAH+EYr mClL1oNRsoMiKnITCbHn17KJkGQ+jD3VKk/I/0/hwDrYu/RQGcDk7audz/D57orUiy /cxXXdFp5AJ2yRhq93nzsLVAwZvg6PBbpG3oF7QlGXyQo5XrOjnyen+SWh9PTgbNbQ HQ8qct/WIMoot9QSzLZ/jzIUombzU018pC25Q2vx9AlNuzKIAjmTtia3NJvPyZF/Gq pNRIf98mpsKfQ== Date: Thu, 20 Aug 2026 13:41:17 +0100 From: "Lorenzo Stoakes (ARM)" To: Andrew Morton , David Hildenbrand , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 02/16] mm: provide vma_[flags_]is_cow_mapping() and remove is_cow_mapping() Message-ID: References: <20260813-b4-scalable-cow-virt-pgoff-v5-0-c21581c0c3c8@kernel.org> <20260813-b4-scalable-cow-virt-pgoff-v5-2-c21581c0c3c8@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260813-b4-scalable-cow-virt-pgoff-v5-2-c21581c0c3c8@kernel.org> (trim cc-list) On Thu, Aug 13, 2026 at 06:32:19PM +0100, Lorenzo Stoakes (ARM) wrote: ... > diff --git a/include/linux/mm.h b/include/linux/mm.h > index df78847f5f07..199d0a64b14a 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -2271,17 +2271,76 @@ void unpin_user_pages(struct page **pages, unsigned long npages); > void unpin_user_folio(struct folio *folio, unsigned long npages); > void unpin_folios(struct folio **folios, unsigned long nfolios); > ... > +/** > + * vma_is_cow_mapping() - Is this VMA a CoW mapping? > + * @desc: The VMA to check. Andrew - a small typo here, this should be @vma not @desc, are you still to fix this in place? If not can always send a fixup patch next cycle :)) (Credit to David's scripts for finding this! :) > + * > + * See vma_flags_is_cow_mapping() for details. > + * > + * Returns: true if the VMA is a CoW mapping, otherwise false. > + */ > +static inline bool vma_is_cow_mapping(const struct vm_area_struct *vma) > { > - return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; > + return vma_flags_is_cow_mapping(&vma->flags); > } > -- Cheers, Lorenzo