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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3693C3DA7F for ; Tue, 30 Jul 2024 20:18:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2437D6B007B; Tue, 30 Jul 2024 16:18:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CD036B0082; Tue, 30 Jul 2024 16:18:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 046376B0089; Tue, 30 Jul 2024 16:18:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D6E846B007B for ; Tue, 30 Jul 2024 16:18:20 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 554901A04B5 for ; Tue, 30 Jul 2024 20:18:20 +0000 (UTC) X-FDA: 82397531160.07.FA73895 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by imf21.hostedemail.com (Postfix) with ESMTP id 5447F1C0041 for ; Tue, 30 Jul 2024 20:18:18 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cDA4gkJe; spf=pass (imf21.hostedemail.com: domain of olsajiri@gmail.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=olsajiri@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722370670; a=rsa-sha256; cv=none; b=YnKyGIt/M/UT5C1QSfJuug/1pleYcSJ9ZY91OF/pxuJLlCtZI9zquRaCl3PsSqfX3cUYYL yhE2IadW6I/qUJnrUOp+AX4Fsp5LdK5A6x4vIDLJ3ly3+j4cWADsdwSj/AGF1fxfMM+kmu aO/m2nBsQTvPwagG2kudvIW7yli9bgw= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cDA4gkJe; spf=pass (imf21.hostedemail.com: domain of olsajiri@gmail.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=olsajiri@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722370670; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FlhooE7niwo1WBnVupTrKx8b0vXnwiGF9kNI8j5y/Hk=; b=hAC/OFp63ci7VRwDr4cW0w/wjI3yIIdww1hEnlaIMpUMOv1dxUPRNgLTdkQHKHPV4aJaK+ iY15V/ZFKA3P2uV5Mo3DCclzYMEnDsnFx7LH3ijQvgKdUp6afSuE6lXL8WZm57FOLUjn4Q 7MRa4hayEs024CtlPoJAk4A6DCg7kTE= Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-427b1d4da32so1364065e9.0 for ; Tue, 30 Jul 2024 13:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722370697; x=1722975497; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=FlhooE7niwo1WBnVupTrKx8b0vXnwiGF9kNI8j5y/Hk=; b=cDA4gkJecKFmcskjgjO2JPGT5dgOHJIgZgsro5pno+JAuoZkrgn5f/WBj+V2lkp9R3 LrhWsLDxrznNu4wqfLPyXHzc1uud5Ce+kKTNgwNtPUPrItZQP+669vV0iaW1Temom+1e pbJw/JNDDq/sog0g+JCnifFctw8/jXnT8c7Udepqts9dZv/QqMFt95STqcX2OOb5t3GM kIiZUSZgXrulo5ex3ntzZK9aXoLNOwWa2J1GEi0C2vMhXpUJZWccyJkubRarPYDMZs9w pdlTrnrjVHtk/Eg/H8el7jx7R2c0BPFZhSKuAtHE9DbGncwtv34s/krGfCcd5hs5bySy rpmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722370697; x=1722975497; h=in-reply-to:content-transfer-encoding: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=FlhooE7niwo1WBnVupTrKx8b0vXnwiGF9kNI8j5y/Hk=; b=Vjg1kGhyJwwiuXEF87RFc+pVRvkRxsFt7P+RcNyyJtfL+T5rCFfhmjsCPHcotETL5X 3UblxKgkqBi7i//GO7EAjqJ6XdMzsTbIygTvLAxqBatNwE/2VY8ly5DFBc0A+35fF3at NxG7zyBtt5saQRuXLxHxT0XSxLl0n81YJRVe6I4rTCjr7IoP8L3oE+Z9C8KbdsjxrJDK bzytPL1k+M+flquavztrP129311GnNF3rzLv8Dy61/W23V60s1FedjhZRS5nMY5B25Xx k54mEuEiyP6OgCAWI3zwhX0sWr3hEpsrjUws0J+2Gc6g4cXV6R4FqIzar1kI9kruWr4z 0xIw== X-Forwarded-Encrypted: i=1; AJvYcCU/uM22rYtqM5raeVRAEN2eqf87Ja0ka/iQzJNnlv0m0h+o4FBmTtVsZhuv0L6YhFUjZi246V/KYCHlJitCNyFYuWE= X-Gm-Message-State: AOJu0Yyo8VDenUciI74n8gkA5pYPQOjU0l5CC0KPTYfwH8znekvlxiag yHtwEaQBginwFt+ySb7iLb59y6MoD82eBoRY37/WPoxjMnbvj4xs X-Google-Smtp-Source: AGHT+IGMm9oFkni0kDXLqhoSNz4U1Okan6JCJTR+tGpNho6VJ6EXoc8DPyxFVyUBjH3zwL/q4i92tw== X-Received: by 2002:a05:600c:3511:b0:426:67f9:a7d8 with SMTP id 5b1f17b1804b1-4282440e013mr21800865e9.9.1722370696441; Tue, 30 Jul 2024 13:18:16 -0700 (PDT) Received: from krava (85-193-35-46.rib.o2.cz. [85.193.35.46]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b36857d71sm15335919f8f.80.2024.07.30.13.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 13:18:16 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Tue, 30 Jul 2024 22:18:09 +0200 To: Andrii Nakryiko Cc: Jiri Olsa , Andrii Nakryiko , bpf@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, adobriyan@gmail.com, shakeel.butt@linux.dev, hannes@cmpxchg.org, ak@linux.intel.com, osandov@osandov.com, song@kernel.org Subject: Re: [PATCH v2 bpf-next 10/10] selftests/bpf: add build ID tests Message-ID: References: <20240724225210.545423-1-andrii@kernel.org> <20240724225210.545423-11-andrii@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Stat-Signature: eu883afjcjxsn74ftq4e9ys7ag3h3dfq X-Rspamd-Queue-Id: 5447F1C0041 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722370698-675440 X-HE-Meta: U2FsdGVkX19o6oAwkMOYO5WGDLNa8fanIRhAEiErP6E2wKjK3NEn4GT5Hw8hGeNGv3b5Qbi5GtXMltQ2qq7n5lP4u1qw7JfNDLS6Esv+rrnCxHkePCRyoAxh1UsvZRZxTmp+7B+re4xxIVYaq7oA425ehHS2KWXVM3WLcwj3Ydp11Ool5bv+qB/J44JZyMQuomuZuD5d1D15HeqrnRt1phZUnIztPjIPALU7T3dLfht7dN1f+CkzML1pyvnDaQvKltm3JKmQHemnJpJ0EYx+2+pgoSVepN1c7wg3+2WyD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9xewGhZ+yHa3jVEW+/7Dy1ZWY3zPOvOJHlOuuER9E32xu6VL4zF2OxXkjilBDtafYq2s6WF+1tj2q/U5T/n42kwsrFv7Lx2betsn7mgMNNkMmv+olZ+5usfCuPvu26gfK9ygOYqQBr8Qy97xh03EpWlosbqdO7FU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Jul 30, 2024 at 01:03:17PM -0700, Andrii Nakryiko wrote: > On Sun, Jul 28, 2024 at 12:38 PM Jiri Olsa wrote: > > > > On Fri, Jul 26, 2024 at 05:37:55PM -0700, Andrii Nakryiko wrote: > > > On Fri, Jul 26, 2024 at 5:27 AM Jiri Olsa wrote: > > > > > > > > On Thu, Jul 25, 2024 at 01:03:55PM -0700, Andrii Nakryiko wrote: > > > > > On Thu, Jul 25, 2024 at 5:12 AM Jiri Olsa wrote: > > > > > > > > > > > > On Wed, Jul 24, 2024 at 03:52:10PM -0700, Andrii Nakryiko wrote: > > > > > > > Add a new set of tests validating behavior of capturing stack traces > > > > > > > with build ID. We extend uprobe_multi target binary with ability to > > > > > > > trigger uprobe (so that we can capture stack traces from it), but also > > > > > > > we allow to force build ID data to be either resident or non-resident in > > > > > > > memory (see also a comment about quirks of MADV_PAGEOUT). > > > > > > > > > > > > > > That way we can validate that in non-sleepable context we won't get > > > > > > > build ID (as expected), but with sleepable uprobes we will get that > > > > > > > build ID regardless of it being physically present in memory. > > > > > > > > > > > > > > Also, we add a small add-on linker script which reorders > > > > > > > .note.gnu.build-id section and puts it after (big) .text section, > > > > > > > putting build ID data outside of the very first page of ELF file. This > > > > > > > will test all the relaxations we did in build ID parsing logic in kernel > > > > > > > thanks to freader abstraction. > > > > > > > > > > > > > > Signed-off-by: Andrii Nakryiko > > > > > > > > > > > > one of my bpf selftests runs showed: > > > > > > > > > > > > test_build_id:PASS:parse_build_id 0 nsec > > > > > > subtest_nofault:PASS:skel_open 0 nsec > > > > > > subtest_nofault:PASS:link 0 nsec > > > > > > subtest_nofault:PASS:trigger_uprobe 0 nsec > > > > > > subtest_nofault:PASS:res 0 nsec > > > > > > subtest_nofault:FAIL:build_id_status unexpected build_id_status: actual 1 != expected 2 > > > > > > #42/1 build_id/nofault-paged-out:FAIL > > > > > > #42/2 build_id/nofault-paged-in:OK > > > > > > #42/3 build_id/sleepable:OK > > > > > > #42 build_id:FAIL > > > > > > > > > > > > I could never reproduce again.. but I wonder the the page could sneak > > > > > > in before the bpf program is hit and the buildid will get parsed? > > > > > > > > > > > > > > > > Yes, and I just realized that I forgot to mark this test as serial. If > > > > > there is parallel test that also runs uprobe_multi and that causes > > > > > build_id page to be paged in into page cache, then this might succeed. > > > > > So I need to mark the test itself serial. > > > > > > > > > > Another issue which I was debugging (and fixed) yesterday was that if > > > > > the memory passed for MADV_PAGEOUT is not yet memory mapped into the > > > > > current process, then it won't be really removed from the page cache. > > > > > I avoid that by first paging it in, and then MADV_PAGEOUT. > > > > > > > > ok, I triggered that in serial run, so I probably hit this one > > > > > > > > > > you did it with v2 of the patch set? I had this bug in v1, but v2 > > > should be fine, as far as I understand (due to unconditional > > > madvise(addr, page_sz, MADV_POPULATE_READ); before madvise(addr, > > > page_sz, MADV_PAGEOUT)). At least I haven't been able to reproduce > > > that anymore and BPF CI is now happy as well. > > > > yes, it's with v2 and I can still see that.. but only for the first run of > > the test after reboot.. so far I have no clue.. I can see the successful > > page-out madvise (still not sure how much is that telling about the page > > being paged out), and then the build id code sees the page just fine > > > > attaching my .config in case > > > > I wasn't able to repro this, sorry. It works very reliably for me with > your or my config. Given it also seems to work reliably in BPF CI, I'm > still inclined to add this tests, I think it's good to have that > coverage. > > I'll monitor, and if it becomes flaky, we'll need to reassess this, of course. np, I'll try to spend some more time on it jirka