From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACF58C47DDF for ; Wed, 24 Jan 2024 12:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tXDMFA6G91bzr56e0LPqIHuy+kIXimBRpojVAOIKFhs=; b=ANNaAP2uI2/5SE U4xM01MYTQ/5OiSUsHgtkn8uIn11aDVAjVChZ/hbYpRTYsluer186bEpNQEydNldiq2EuIgHEdzGG gbTNc15JjUSeHlK0ohH/X5nVUIP5I9oV7HxzTRjpsdaeHD17Y5ZmCek68zWR05xLP+tqvPJvnQNtO TvtsUe5PD3vZnJD0qbE/htRhUwd+JzSh8/zoPIbUcaDAYIGxtAOD5GICdW9x90uxQSpsu52iVzi+C hkWit478JpBHta1lnUixXUQMgMGy0WxpOPJttxlVnwlx25dXAyd3942ghO78BJj7+1L7SkLzdMT8A sW6mVtfHfeju4nEBe9fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSc2A-0036Or-0W; Wed, 24 Jan 2024 12:07:10 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSc27-0036L7-04 for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 12:07:08 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40eb033c1b0so32731395e9.2 for ; Wed, 24 Jan 2024 04:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706098020; x=1706702820; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=yHQXrQZm7ePexKbK+DrR/AWby1OxOJCAQLEUzKUQttg=; b=e7yWLAgpcEBigi4PrGNxs1ZgH+CdZ68ELMgXI+d6Ne8TXv3EqY9o94gCiQEnuGP2tl c5hsyzYDrBIqljEUnNEUHnhZtiMOPRs5fkKlfawryvPzCjzNrmAnBQa69aZpwLG5b6OW rtGyz9HJGUwh3A3oLj3ehMG2HNTp2v5Be0Fls+Ou2Hh6DIwqtv6YOHt+XP8HbdZBKbej 8qNat21p30RYS7n8sNh7foq1o2NoUnnJ3NtJn2uNKLLQ/Bza3dPGU7izCpRnXs1ujIA4 bWvKPxSd5ppZDGKPG7dgKzaAMoOQqETLpuGN9U4HJ5b0quYSSrzNn6GPHmJtoxDiBDXF JHgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706098020; x=1706702820; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yHQXrQZm7ePexKbK+DrR/AWby1OxOJCAQLEUzKUQttg=; b=NuapFhXUx4zRqTOFmzMjgJ4TAUeLHm9a8F/hthsP5nh7WQpsCOtgezgdqVgx3eCRjl n7w69Q3FQYMe1IUBkK14rB3AiHgxaF8Xh9ocU5a3cA8eY7UqH4x88N+MhivyeDpRsPBU eZUnjWAx4SzFpnQMwVZra+QFWFwqMyAPj8gBO7vcD6lHoeXR44kGb4nwccazlsJ58pc/ UASejEJLvPh1WAZ8PhoZZq+bEXBkIZerzd6xoJLfqCdvlklsgnIxzblFvknXI93PPDrZ EDPEmEo03u7TjxWTnQgK+aFPN2ur7CWO4BtGA6g+dklN7w+JVdMLAfYrCU6lAQsbv8DK wCRQ== X-Gm-Message-State: AOJu0YwGBSkBgrXx6OTTYdRj8sGN1JU4h+i9wWh3eEsJiaLq7sHx5jVn 5zd3+jlFV/s5OYm/38Cqm3VjXMfjzbJqJJ8v8Ss1CrJO1XP7PyCH X-Google-Smtp-Source: AGHT+IFkNvD40vJ0a1mrsGf7S5l+J9ij556hvdrCOjt5RYOPGErcAQgD0x471iQCkK6f4ZjjEVIRqQ== X-Received: by 2002:a05:600c:444:b0:40e:70fe:e179 with SMTP id s4-20020a05600c044400b0040e70fee179mr1149407wmb.182.1706098019848; Wed, 24 Jan 2024 04:06:59 -0800 (PST) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id n4-20020adffe04000000b00339272c885csm11436040wrr.87.2024.01.24.04.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 04:06:59 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Wed, 24 Jan 2024 13:06:57 +0100 To: Ryan Roberts Cc: Jiri Olsa , Sven Schnelle , 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() Message-ID: 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> <6caaced7-a9d7-4fe4-823a-11b96be83e46@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6caaced7-a9d7-4fe4-823a-11b96be83e46@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_040707_062203_DC880337 X-CRM114-Status: GOOD ( 32.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 24, 2024 at 12:02:53PM +0000, Ryan Roberts wrote: > On 24/01/2024 11:19, Jiri Olsa wrote: > > On Wed, Jan 24, 2024 at 12:15:52PM +0100, Sven Schnelle wrote: > >> 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? > > > > we hit it as well, but I can see the fix in linux-next/master > > > > 4c137bc28064 uprobes: use pagesize-aligned virtual address when replacing pages > > Yes that's the one. Just to confirm: you are still hitting the VM_BUG_ON despite > having this change in your kernel? Could you please send over the full bug log? ah sorry.. I meant the change fixes the problem for us, it just did not yet propagate through the merge cycle into bpf trees.. but I can see it in linux-next tree, so it's probably just matter of time jirka _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel