Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1058041rdb; Wed, 24 Jan 2024 03:45:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFG8h5HSltCMcBtfYzk13skxA2z2H+fh3cvRfyvJBeoiCc5Zd3TmmZWOQNrI0dJST/NGKI X-Received: by 2002:a92:c64b:0:b0:361:92f8:88b5 with SMTP id 11-20020a92c64b000000b0036192f888b5mr1426245ill.106.1706096719083; Wed, 24 Jan 2024 03:45:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706096719; cv=pass; d=google.com; s=arc-20160816; b=eGka5pWAU8eHhMcQ3dE/yiOJYGUJ1tN7fiHTj4Jg0KYjrf2mIPSKNoeNmJNpPTLSWG aY5DpNVpouycn39fJLg+dUWzIogNlVmCnZUWup0mbqZmKaIfo0yAKSXwHCUn9PVv8xL2 1MqQXND1NBDBgSq6mfM3LQGQ4JXxFhmKhhZGjj5PikGtf2m16HMdQmRI1FQ7RY43GT3F 56aXfoXci0P19S5CSga5Qn78YmzEIdgjeqFOEKUPhAXKw1YnuFtzlEiML5GOqIhVH+Ab 0GFOTAXddE2V+tEkWRQMcn/N0aE3yhEW0LzRgu3yMKjIC4fND+0332PIle8pC9DVmWCC k9Yg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=XwsDcvUycr6MZCgZkrrnEzPidiDuzn7kT9+I19kmcFE=; fh=LYTtjbGTxEb/lpi1ouCYZI32dlnuW6r7WZvv/CCmPJs=; b=P8cwXhngkC6F0BHv774hvJv3S5m+wKkupNQHwpWWKOerOh6aWSxGA49Frk1RlOyfRT DK5kOpvXP1bItH8Jm9iljecuWgyp3IAeDOgYuGLqWYRrtvDrnlMnaIyNw3Vr634S0bYP vWEo2iV87HESCK/zeTqednxJLvenjF0hd1Pqy8QrFsjweaeUTxythXwxtoPbSUOveclZ webQKobmk0JMj8HELLL3VhKYHB8BF+hBPJQxdi0+ZzMw0vS8zyyQXBmPj2nYFSCURvXq JgRiEcvOWZYYH8N1y32N6KFQhK7flZS1373118nLhpSxRUjBy7SBaDys3HNXjjuuNtnS VbqQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Ne4fHdrW; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-36837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 77-20020a630150000000b005d58b2f646esi212686pgb.859.2024.01.24.03.45.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 03:45:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Ne4fHdrW; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-36837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AB08BB2692D for ; Wed, 24 Jan 2024 11:16:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E24D01AAD2; Wed, 24 Jan 2024 11:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Ne4fHdrW" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 0BFF21AAB1; Wed, 24 Jan 2024 11:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706095004; cv=none; b=h3BsnpTbbn6r8pGfSWNG6WKKQ+j93Tm1HzQ4tZ9o3RkgIDxgRIiw4GDPWEFj39Gjds52/LGRbQTq9/zikiGLOSvTTJJ6nO/nhyhoX5kLKUjNXWhOR/tqirLQYwFLm253X0yNXfphHstXFCKLNOyVGWNzRCDA672ZuDN8uYG5kEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706095004; c=relaxed/simple; bh=+urhngMzgJ0quyKjYQ0ggpLPBFKqVLr5OUEYXqueFAk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: Content-Type:MIME-Version; b=uApDUjvKUptdftK0D5NE5YJWeRLdE5OrHX23ZxwEeWXFvgOiAY/aLjoYYMNuDH9IllGPTzp+4Pq1Ho/M7VFpXjWSElmk2U94sVuoObj5Rhr/KA/BeFMU3uQdH7zniotlNtzVmmaVJfY5b3ZgDz9hwNyJdgioiyJkk0qWrGUtKiw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Ne4fHdrW; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40OAxnfX001738; Wed, 24 Jan 2024 11:15:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : content-type : mime-version; s=pp1; bh=XwsDcvUycr6MZCgZkrrnEzPidiDuzn7kT9+I19kmcFE=; b=Ne4fHdrWAnrGW7oMca75rLonV+7RFF6zoUNURr291Vn6+pArfcOMDqKs5pO2jvuO/0iS VW1ciO41rpA6r3TAdhYdpaosgMf4kgTORsurdBnBQPk+ZPMHoZnxabyAGSMKmka96Zv7 KjHZkL9qxoXZvRbGN4erCJFe1T5Vn/4XUt8Nyr1oHoggD9ckNGdnrR/Fm3zKDp7QbYAB DHPFe83/d6Rt98vweOVSVZpXfXSqmA2VfxGwb4FahUsLbG4KTisTLulOF1PUugUywwTm VcKAxUnY2RTYOw2HCWXLIw/CTC+cW2+QUjHyZwMreHB5gYExluP2U22Q8+zJlSwTfcd0 8w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vu0cd1umv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 11:15:58 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 40OAxuxV002552; Wed, 24 Jan 2024 11:15:57 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vu0cd1ukj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 11:15:56 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40O8UAAB025268; Wed, 24 Jan 2024 11:15:55 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3vrtqkd269-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 11:15:55 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40OBFrUK39125384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Jan 2024 11:15:53 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44CAA20043; Wed, 24 Jan 2024 11:15:53 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 76A8C20040; Wed, 24 Jan 2024 11:15:52 +0000 (GMT) Received: from tuxmaker.linux.ibm.com (unknown [9.152.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 24 Jan 2024 11:15:52 +0000 (GMT) From: Sven Schnelle To: Ryan Roberts Cc: Jiri Olsa , David Hildenbrand , Andrew Morton , Matthew Wilcox , Yin Fengwei , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins , Kefeng Wang , Barry Song <21cnbao@gmail.com>, Alistair Popple , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Barry Song , linux-s390@vger.kernel.org Subject: Re: [PATCH v9 02/10] mm: Non-pmd-mappable, large folios for folio_add_new_anon_rmap() In-Reply-To: <1188e67e-5c04-4bb5-b242-78d92c3fc85c@arm.com> (Ryan Roberts's message of "Mon, 15 Jan 2024 08:50:19 +0000") References: <20231207161211.2374093-1-ryan.roberts@arm.com> <20231207161211.2374093-3-ryan.roberts@arm.com> <41dc7dff-1ea8-4894-a487-88d46ec2b2d8@redhat.com> <1188e67e-5c04-4bb5-b242-78d92c3fc85c@arm.com> Date: Wed, 24 Jan 2024 12:15:52 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5VToK-l8Q8W53Es6vhZ8EvF7HGfvts8A X-Proofpoint-ORIG-GUID: K9bgcSWDgXer_hJD1KufHgSOFVoGI3i6 X-Proofpoint-UnRewURL: 0 URL was un-rewritten Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-24_05,2024-01-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 mlxscore=0 impostorscore=0 spamscore=0 priorityscore=1501 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401240080 Ryan Roberts writes: > On 14/01/2024 20:55, Jiri Olsa wrote: >> On Sun, Jan 14, 2024 at 06:33:56PM +0100, David Hildenbrand wrote: >>> On 13.01.24 23:42, Jiri Olsa wrote: >>>> On Thu, Dec 07, 2023 at 04:12:03PM +0000, Ryan Roberts wrote: >>>>> In preparation for supporting anonymous multi-size THP, improve >>>>> folio_add_new_anon_rmap() to allow a non-pmd-mappable, large folio to be >>>>> passed to it. In this case, all contained pages are accounted using the >>>>> order-0 folio (or base page) scheme. >>>>> >>>>> Reviewed-by: Yu Zhao >>>>> Reviewed-by: Yin Fengwei >>>>> Reviewed-by: David Hildenbrand >>>>> Reviewed-by: Barry Song >>>>> Tested-by: Kefeng Wang >>>>> Tested-by: John Hubbard >>>>> Signed-off-by: Ryan Roberts >>>>> --- >>>>> mm/rmap.c | 28 ++++++++++++++++++++-------- >>>>> 1 file changed, 20 insertions(+), 8 deletions(-) >>>>> >>>>> diff --git a/mm/rmap.c b/mm/rmap.c >>>>> index 2a1e45e6419f..846fc79f3ca9 100644 >>>>> --- a/mm/rmap.c >>>>> +++ b/mm/rmap.c >>>>> @@ -1335,32 +1335,44 @@ void page_add_anon_rmap(struct page *page, struct vm_area_struct *vma, >>>>> * This means the inc-and-test can be bypassed. >>>>> * The folio does not have to be locked. >>>>> * >>>>> - * If the folio is large, it is accounted as a THP. As the folio >>>>> + * If the folio is pmd-mappable, it is accounted as a THP. As the folio >>>>> * is new, it's assumed to be mapped exclusively by a single process. >>>>> */ >>>>> void folio_add_new_anon_rmap(struct folio *folio, struct vm_area_struct *vma, >>>>> unsigned long address) >>>>> { >>>>> - int nr; >>>>> + int nr = folio_nr_pages(folio); >>>>> - VM_BUG_ON_VMA(address < vma->vm_start || address >= vma->vm_end, vma); >>>>> + VM_BUG_ON_VMA(address < vma->vm_start || >>>>> + address + (nr << PAGE_SHIFT) > vma->vm_end, vma); >>>> >>>> hi, >>>> I'm hitting this bug (console output below) with adding uprobe >>>> on simple program like: >>>> >>>> $ cat up.c >>>> int main(void) >>>> { >>>> return 0; >>>> } >>>> >>>> # bpftrace -e 'uprobe:/home/jolsa/up:_start {}' >>>> >>>> $ ./up >>>> >>>> it's on top of current linus tree master: >>>> 052d534373b7 Merge tag 'exfat-for-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat >>>> >>>> before this patch it seems to work, I can send my .config if needed > > Thanks for the bug report! I just hit the same bug in our CI, but can't find the fix in -next. Is this in the queue somewhere? Thanks Sven