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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AA7BC46467 for ; Tue, 10 Jan 2023 03:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbjAJDoU (ORCPT ); Mon, 9 Jan 2023 22:44:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbjAJDoS (ORCPT ); Mon, 9 Jan 2023 22:44:18 -0500 Received: from out-146.mta0.migadu.com (out-146.mta0.migadu.com [91.218.175.146]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8E601EEE1 for ; Mon, 9 Jan 2023 19:44:17 -0800 (PST) Message-ID: <7a476ec6-9bd0-beec-00ff-e8cd0121ce57@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1673322256; h=from:from: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; bh=XadTJY4of2M6MLVPR0KC+JPokPjO4xpBN+kyvzgjFQk=; b=TCYiY2TG6x/jFJWWp9mWRkNrbjaYeAlOGaFaTKrQ9d2UVjg5xRCnXirk8MsD1hOQMc79Pw Q3ntXL7ZSfV59OsnzjMugALPa1ji/ZLmKsHbKZxEpUiN2VKevmp413NdouYIC6TusnpJDi ZTngdT/62eI2AvXZ4AW58agKI7bgAmw= Date: Mon, 9 Jan 2023 19:44:11 -0800 MIME-Version: 1.0 Subject: Re: [bpf-next v4 2/2] selftests/bpf: add test case for htab map Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau To: Tonghao Zhang Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hou Tao , bpf@vger.kernel.org, Manu Bretelle References: <20230105092637.35069-1-tong@infragraf.org> <20230105092637.35069-2-tong@infragraf.org> <6bd49922-9d38-3bf9-47e8-3208adfd2f31@linux.dev> <85737292-efbf-636c-99f1-39569cd215c8@linux.dev> In-Reply-To: <85737292-efbf-636c-99f1-39569cd215c8@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 1/9/23 7:25 PM, Martin KaFai Lau wrote: >>> >>> btw, from a quick look at __perf_event_overflow, I suspect doing the >>> bpf_map_update_elem() here instead of the fentry/perf_event_overflow above >>> can also reproduce the patch 1 issue? >> No >> bpf_overflow_handler will check the bpf_prog_active, if syscall increase it, >> bpf_overflow_handler will skip the bpf prog. > > tbh, I am quite surprised the bpf_prog_active would be noisy enough to avoid > this deadlock being reproduced easily. fwiw, I just tried doing map_update here > and can reproduce it in the very first run. Correcting my self. I only reproduced the warning splat but not the deadlock. This test is using map_update from the syscall that bumps the prog_active. Agree that SEC("perf_event") alone won't work unless the bpf_map_update_elem() is not done from the syscall in prog_tests/htab_deadlock.c, eg. from another bpf prog.