Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1521169pxb; Fri, 22 Jan 2021 19:31:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJ7gsgp9uKjQLItZXytznFECMHpUe+yNZSYCLCedhuxlr0RxBIDkCNBS6IWTWD+gft5zQM X-Received: by 2002:aa7:d2d4:: with SMTP id k20mr608760edr.361.1611372663821; Fri, 22 Jan 2021 19:31:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611372663; cv=none; d=google.com; s=arc-20160816; b=ohydlqEn4snVoX0HfkxOLiLHcqrZ1gBEyI0idm9BIQJ2IYqkLT9Fha/xMDmfGO9ojW FlscSqAhBCqotkP769+XEm2+FsF7PNjyR7K+wSLJ0PxJ1Pai88NssL9Tuv9zMNFpAho9 b7GwrmQidLrEqGafx9J+wLaIkcxE2lRfxe/PZNy0vEXGmKImWqdB5qasmryj5lGpPuuP Vw7tkEzesGvNJMpVGSDdTFbfi6vOmtNI846pQ3NntNfDI2Qm5h4zd6mPtuD1GDPhH0We M3RUywIhZ2hAs3uuJdTgIXWgtxlIAq8e7bcHCVof5z6OOTjcwIW7/+uy+gNrU/GWNgGP CjhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Y63ezxhE9y61i4ONjRBHzW6xiIvx1qUMUf4Z/Rhvgp0=; b=ihS4HlUrMjoBsSem6RKPd0vOPJlMKMc0ddBMdKsvutkqZND5IPogFrdkHAQe0p/CyK 9+r4p2K24rOiK/nxjAIYT/R2MmHJTv0UpHfAA3pgK/XiiD3smvqhCCz+Gg19DOzHhSK9 Svp7RW+LDI8HHgIY5jeC2BXnFCHajmWyVMC3MkW1B1Y3d7Zm+LPJAEnLynFSNjD/ODnf fEnDFsvna8EymWI+DZZm44fi37MwAst7jjJOrywyWegxAmuJkwwNwQ1al3f0BITA59SW eVIJCKfWZi0NQ00VC0VCmFkOrq9lGX4sGfpkhkxiwT+nYzulpGxM1oZ7ZZuAnjh8t5er qa+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JBiEK2Sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si3617008ejz.530.2021.01.22.19.30.39; Fri, 22 Jan 2021 19:31:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JBiEK2Sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbhAWD2r (ORCPT + 99 others); Fri, 22 Jan 2021 22:28:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbhAWD21 (ORCPT ); Fri, 22 Jan 2021 22:28:27 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E9DC06174A; Fri, 22 Jan 2021 19:27:47 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id 30so5139912pgr.6; Fri, 22 Jan 2021 19:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y63ezxhE9y61i4ONjRBHzW6xiIvx1qUMUf4Z/Rhvgp0=; b=JBiEK2Sr+NPccQrh4kmyjqK1PO9wHEgrQeEE1SIDCJkGCSZ0yraYOoJsGQvf5NVxe7 fwhUE4d6jUG3uUncgwndLpglX9gftVNiw9JC9M6L0e+sCbAinWsYPyXzeUR2IVFuZQXS VZpd+pJvaFJGVKrFt1narbL5mIm8dTgAovCEQFFahaVQygOGmCMqnnpO3d1GZRf+rUjh fazrMXNvZJpK51CIkwvg7iUhkoR3vc1Ykod3mbklZCIiwkyrUnpF6AGXpk1z3iOEEPzP WF3/vYGsqaYM02CU5SpXtLltlsZgTuiCxl6Zsg1pS56X1xWMUmoG35ycGBu/TolaHQ5H 9XKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y63ezxhE9y61i4ONjRBHzW6xiIvx1qUMUf4Z/Rhvgp0=; b=HXB1emMJz41O5KkikdE5m+W9hDtnqM+Yu1lC/I5b0v/r421MDPpk4j8yMg/EMdkEtP gbzluP2ZBjp4r+wQPnlDflnPR2BCvRri84LiBVzEI5YVDLJZ0+geawx/EsdGlnhpEp0F OUWkx5r6O2Z5mbTBBJwQ5Eke6DlKOvrHYC0gL84+K83zIKNWnH56g29uJZwdbfx6sn92 qcnHrJNF+RA+KveAqopJkdY1jpWfXe3EHdmdgFHwGAV8rRKwYpSFZv+am5urEhes6ed9 xCWq/rDUbT2sqoPw8RqaAjq5Q1VoCE0TBnuzsZUWvqZmYq6o8euaPDjadUVtoCDw40hw k//Q== X-Gm-Message-State: AOAM533QvY7uOJgXcU6ubjSTTjxOVTYcix1sI8FM/BALjrxqzPN6MZlp PJO9lTKvJVBjBouylvFWONnQ7kMBeu8Uhgqedf8= X-Received: by 2002:a63:2265:: with SMTP id t37mr387298pgm.336.1611372466644; Fri, 22 Jan 2021 19:27:46 -0800 (PST) MIME-Version: 1.0 References: <6af41136-4344-73da-f821-e831674be473@i-love.sakura.ne.jp> <70d427e8-7281-0aae-c524-813d73eca2d7@ozlabs.ru> <6eaafbd8-1c10-75df-75ae-9afa0861f69b@i-love.sakura.ne.jp> In-Reply-To: From: Cong Wang Date: Fri, 22 Jan 2021 19:27:35 -0800 Message-ID: Subject: Re: BPF: unbounded bpf_map_free_deferred problem To: Tetsuo Handa Cc: netdev , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Linux Kernel Mailing List , Tejun Heo , Alexey Kardashevskiy , Dmitry Vyukov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 4:42 PM Tetsuo Handa wrote: > > Hello, BPF developers. > > Alexey Kardashevskiy is reporting that system_wq gets stuck due to flooding of > unbounded bpf_map_free_deferred work. Use of WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND > workqueue did not solve this problem. Is it possible that a refcount leak somewhere > preventing bpf_map_free_deferred from completing? Please see > https://lkml.kernel.org/r/CACT4Y+Z+kwPM=WUzJ-e359PWeLLqmF0w4Yxp1spzZ=+J0ekrag@mail.gmail.com . > Which map does the reproducer create? And where exactly do those work block on? Different map->ops->map_free() waits for different reasons, for example, htab_map_free() waits for flying htab_elem_free_rcu(). I can't immediately see how they could wait for each other, if this is what you meant above. Thanks.