Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2287965yba; Mon, 15 Apr 2019 08:37:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVz9oBSsCeUpkk+XnNk/G7lW6NxpVkOEFd6qVEgI3hsDp7jIpvytDlcDt+mph/xNBPE4ZI X-Received: by 2002:a63:b811:: with SMTP id p17mr70903746pge.219.1555342637984; Mon, 15 Apr 2019 08:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555342637; cv=none; d=google.com; s=arc-20160816; b=yGUhfsEcNd/YKSyAKX+dqyZENjZRzyOjP45bw7XV9AuT/U7NbRP1r3fwPdmtkfvYNZ 9oyl6gZIfk9LDzvhMxiO3/Ruf7CGZogtehhlsicMcfwg7Ggvzn9b3jYZWpDhOa+20Jix a4BMCl+JqgSvmJdQP5KLbkRD+JA3zfyH8oRccX6+QJlWnOeGayFFnsXuCD+EE2UPggEz LUUCZveLiJzzgOAR1TvIrU131WZZxDfiFIGrMTHO5XvwLA7zzUuynu8FOYOJEQIF5BnK VKJ1NQD9o+NcsAapE2rOo4gDfvJdCULbNOGFd2mVsyNIyxoI4I1Ok4CiORUM7gj5+2zJ fzUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :dkim-signature; bh=jL0rxBSC6s9RA9Rb3xPj60KK/pnH46/tuYiS8X+w8P0=; b=ENCWPP8ptuK6gAOlpad+KOLemVVkNEruXZVlRXReGepviNmCidCfXlJ6G6jyTYm6Hm 2TG6Z87Um4FlXIDWp/x4m6L3WMxwqlr7qcuue1jJnnPzE5R5NG9BQg92LKeM8DSWK7El e9Ly0S05vJnQtVdJ43WV65FXlXJbvslo66nVLz3LgL2kLqNjluknGeF58Zn4b9pRqHcp 6afVvMu4TtGviy/Echf6mAjyjujQP7X/SjAwTelQuVQAQu9t9+bl1Q9NwAvzrkqNDIB5 x9AGGYfj+cEA1QzdLvnq8sUa9hvj0cKlOG0mUEgg2SkNcJhar2OCJ+KIjVeHf8pPzHMR jMjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j5E3Sp6J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m13si43274795pgv.582.2019.04.15.08.37.00; Mon, 15 Apr 2019 08:37:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j5E3Sp6J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727626AbfDOPfG (ORCPT + 99 others); Mon, 15 Apr 2019 11:35:06 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33346 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfDOPfF (ORCPT ); Mon, 15 Apr 2019 11:35:05 -0400 Received: by mail-pl1-f193.google.com with SMTP id t16so8757354plo.0; Mon, 15 Apr 2019 08:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=jL0rxBSC6s9RA9Rb3xPj60KK/pnH46/tuYiS8X+w8P0=; b=j5E3Sp6J/IkmeIdaz+/kVg5KImcvzkzEPz+dJWLg7tG+HTS+O8Ug325+/7N2Ismj27 iUhawidFeabncZclhJERBJVVMcWmnZxPTqnmslcvwo1twEX9ssZiRircHYRfDWQfBL2/ y26yBgs4J4+20C8zgnPjvyFA4ZDhlcztee8Sx18jq/HRJ1Z/w5t95KGbMs1mMP9vrUqJ VLFiPHVlgzShTiPvvza3TT9b7MplzNKC/x+W0HYnVkfvrC+sURBNiIKBH2+0f8akNNRY mVCaBcypiF/MFUpHc8i0f5rwO8EcbNkQDSdw2b7olPktL0e7M98oCt7Ri5OznAMp/t+l DHkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=jL0rxBSC6s9RA9Rb3xPj60KK/pnH46/tuYiS8X+w8P0=; b=I7zr0x3MDcRZEMWrxeVmWYYG+bwmJb04pS7UdbIaI6NvwXPKEMOVqF1h5kw+ELirkW WM1V/sey8aa/NrKr6hjGHdggek3wv4VAQgeaQHhoNPNKhJimONvvhay0lzeq9sgtUxh4 MCcwOnKViqfBnbCM+HYzvmRf7xn+KBwO/sh6KvVvHu5qr5162H4d6QD9qa5Wfzeo3RFo 5Nuuv5fTqFOsJMoMZuiy3UsXIFM2APMjgHm06VSMLiFrlADeP45fl64emEXQFVZD7bgw OQHwvwyFYfbNxkgPM3D//O3sqrUWBjUcTVOsvz4g6C6qSoUy4o7U/1uAiWigwxafZidQ MFpA== X-Gm-Message-State: APjAAAUC4j1WIkNOc/bCJZu/wdjmAWRUODB3LnFsO6Wp9qknSOVlEBDG XONVgA985IH8Qz7Hq+1AnIg= X-Received: by 2002:a17:902:141:: with SMTP id 59mr40118319plb.132.1555342504638; Mon, 15 Apr 2019 08:35:04 -0700 (PDT) Received: from ?IPv6:2601:282:800:fd80:91ac:460f:1e02:116c? ([2601:282:800:fd80:91ac:460f:1e02:116c]) by smtp.googlemail.com with ESMTPSA id j9sm66429132pfc.43.2019.04.15.08.35.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 08:35:03 -0700 (PDT) Subject: Re: unregister_netdevice: waiting for DEV to become free (2) To: Tetsuo Handa , Julian Anastasov , Cong Wang Cc: syzbot , ddstreet@ieee.org, dvyukov@google.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <0000000000007d22100573d66078@google.com> <4684eef5-ea50-2965-86a0-492b8b1e4f52@I-love.SAKURA.ne.jp> From: David Ahern Message-ID: Date: Mon, 15 Apr 2019 09:35:01 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4684eef5-ea50-2965-86a0-492b8b1e4f52@I-love.SAKURA.ne.jp> Content-Type: multipart/mixed; boundary="------------DD0480AFFB91D4F7E35D2207" Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------DD0480AFFB91D4F7E35D2207 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 4/15/19 7:36 AM, Tetsuo Handa wrote: > I traced using debug printk() patch shown below. > I find tracepoints (see attached patch) and perf are easier to use to debug device refcnt problems. For example, limit the stack you have to deal with via sysctl -w kernel.perf_event_max_stack=16, and add a filter (e.g., --filter 'name == "lo"') to limit collection to a specific device. --------------DD0480AFFB91D4F7E35D2207 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="0001-Add-tracepoints-to-dev_hold-and-dev_put.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-Add-tracepoints-to-dev_hold-and-dev_put.patch" RnJvbSAwNjhiMWI4MzYyZWM1ZmQxYjlkZmZkYmQ2ZTg0NDc0Y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G5l dF9kZXZpY2UgKmRldikKK3sKKwl0aGlzX2NwdV9kZWMoKmRldi0+cGNwdV9yZWZjbnQpOwor CXRyYWNlX2Rldl9wdXQoZGV2KTsKK30KK0VYUE9SVF9TWU1CT0woZGV2X3B1dCk7CisKKy8q KgorICogICAgICBkZXZfaG9sZCAtIGdldCByZWZlcmVuY2UgdG8gZGV2aWNlCisgKiAgICAg IEBkZXY6IG5ldHdvcmsgZGV2aWNlCisgKgorICogSG9sZCByZWZlcmVuY2UgdG8gZGV2aWNl IHRvIGtlZXAgaXQgZnJvbSBiZWluZyBmcmVlZC4KKyAqLwordm9pZCBkZXZfaG9sZChzdHJ1 Y3QgbmV0X2RldmljZSAqZGV2KQoreworCXRoaXNfY3B1X2luYygqZGV2LT5wY3B1X3JlZmNu dCk7CisJdHJhY2VfZGV2X2hvbGQoZGV2KTsKK30KK0VYUE9SVF9TWU1CT0woZGV2X2hvbGQp OwotLSAKMi4xLjQKCg== --------------DD0480AFFB91D4F7E35D2207--