Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3985826yba; Mon, 29 Apr 2019 11:46:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZ4CHe+M2WC0RGSFCndW2T5M2uDTc0Wu+cbBPv5YFVMLO+ilp59mZZpklN/zmqVqodanLE X-Received: by 2002:a17:902:e285:: with SMTP id cf5mr27196339plb.77.1556563568049; Mon, 29 Apr 2019 11:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556563568; cv=none; d=google.com; s=arc-20160816; b=vX9oq5EKlbffht3DYqkjj+IsbQt4EiX3MnicNYvi+LVok223kKe86hwoQqV3i3recR lpI7gDzjehda+O9VHng819/ewlLkStTYNJvZJevWYwXRVgox7khITA4qzhvpDY2YqiCy DUYuta/kYUTRJW9hQhBFBTyNJWE0TG1wdZpbjXzFgDAAWCbegSqdbyuhA1EtcaX0vxxP fKahlh5UoMxyIQ40wJjXvvn1HIv1nMkIVBv7ZHFMZg8q1uX+c3KeAK+D4qqNL8uAVcry GtugO6LaIxUbiyaJlyW0pCgnnlmuZBUjJ2NhgpCzfLwBN6A3jsYXEIalkLHIsV+mvTIp Q8jg== 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=BQ3C86GZREydUaCz0afmFgD6JoCVkrw+ph7zwQtPSd8=; b=EVevQQEjH7PZrjykjHEIcA4n6kKj2rGh7YQLa1xbYEKmr76iIdmoAP2srXZre5RdLC xC8qQ5r/IsUP1vPzshE4jqRGIKnX/6Q/A1c3lci7+22Bck0bS1unII9AhnH/6GeBrghd qGxMsMZLwPekaLI26FsEX5LSyidMZksgWToUNlrOyIANdDroFHRX/tIeoK8UPufci8iY 3E1LMWTyIdzsmL9ONRO5VLqMP9Q3avWiN3N7sfulriL5oqfoATGDYdCw0+AlgmnCC62B 1DJOOr8B1z3O4XgL146Bq2oswLb+n7RZ2y5rqiyFTGFeDXu78xYtIOUu4gZmc2SDZzNG rQHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gWXpB251; 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 o15si11863763pgb.393.2019.04.29.11.45.52; Mon, 29 Apr 2019 11:46:08 -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=gWXpB251; 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 S1729216AbfD2SnU (ORCPT + 99 others); Mon, 29 Apr 2019 14:43:20 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44052 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728946AbfD2SnT (ORCPT ); Mon, 29 Apr 2019 14:43:19 -0400 Received: by mail-pg1-f196.google.com with SMTP id z16so5567333pgv.11; Mon, 29 Apr 2019 11:43:18 -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=BQ3C86GZREydUaCz0afmFgD6JoCVkrw+ph7zwQtPSd8=; b=gWXpB2518rHeRXMNSaY9SOXHzJEDw2gQPD3i97nYJ9iSAh3gS/Dsy3MpHdLqKD7O9j 7M3CFmerec2nVCIgaTBiAkfJsluQ3s8UW2f4A6KX2KVg7n2luzCdtMIaYZVEPkTLlHYk QhpGRQ04kgHeTvXEuERtT5f1XZfc7W4Di8Ql+dPNdGcKKecDTnSLLtZ0tien+fodFgNp UaCHhY5b6AWmpr7Fx6TYp4VC7fo7ul19GNyNGApyBS041uwDBqpcIzZWr3YnhsWg9V8Y TtIjfR8Add42KdkZfYiMBuV4P944MF3feEAuCDdccwBHTvJ3eIzQPWSoJVXIC6VJWNDV bZkg== 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=BQ3C86GZREydUaCz0afmFgD6JoCVkrw+ph7zwQtPSd8=; b=c9XVFlF+87botix4XGr/k7EHwI9a6cOxhnLnCwikN2+GSDQSUqzjOrH2f86ZvYgvKQ uU9QEm3JaPvjli2fdc5Mqj8z5yHLmImxgUKwdfzQWRBCr4QgLtrUOcZJ91twwHXlYAfd Ljoz7Ta6RDIqblVUh07tb24EMMErB1OLSItO3KOg0roUk1opeSp0gRWK8NLmOW/mFwvC rHOUNPLsOOVoCkIdsi5W4Od55b+YpQYJn3bnc0gzIMF33H43c+sFRtmZ0sgZT6G3gssA ckPFcGYl2nSG9qQ71Ag7Zkr/vsY5RwwQMr+I5WrOjVkEujc3fi3YnEL2pjrhfNRGX6Vl rnhA== X-Gm-Message-State: APjAAAWUpD/s3ukUaz6Anw7Qa/vtDwUPQkiZgIyf9qE6JGSoU2Ob6BN/ vKdiyYow1SEMpKmJApKP2j4= X-Received: by 2002:a63:521c:: with SMTP id g28mr60165132pgb.431.1556563398136; Mon, 29 Apr 2019 11:43:18 -0700 (PDT) Received: from [172.27.227.196] ([216.129.126.118]) by smtp.googlemail.com with ESMTPSA id d8sm37252833pgv.34.2019.04.29.11.43.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 11:43:16 -0700 (PDT) Subject: Re: unregister_netdevice: waiting for DEV to become free (2) To: David Ahern , Tetsuo Handa , Eric Dumazet , "David S. Miller" Cc: Julian Anastasov , Cong Wang , 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> <9d430543-33c3-0d9b-dc77-3a179a8e3919@I-love.SAKURA.ne.jp> <920ebaf1-ee87-0dbb-6805-660c1cbce3d0@I-love.SAKURA.ne.jp> <15b353e9-49a2-f08b-dc45-2e9bad3abfe2@i-love.sakura.ne.jp> <057735f0-4475-7a7b-815f-034b1095fa6c@gmail.com> <6e57bc11-1603-0898-dfd4-0f091901b422@i-love.sakura.ne.jp> From: David Ahern Message-ID: Date: Mon, 29 Apr 2019 12:43:14 -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: Content-Type: multipart/mixed; boundary="------------A130DC68AA00417E350956C2" 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. --------------A130DC68AA00417E350956C2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 4/29/19 12:34 PM, David Ahern wrote: > On 4/27/19 10:22 PM, Tetsuo Handa wrote: >> On 2019/04/28 8:52, Eric Dumazet wrote: >>> On 4/27/19 3:33 PM, Tetsuo Handa wrote: >>>> >>>> I'm waiting for davem why it is safe to move the dst entry from >>>> "a device to unregister" to "a loopback device in that namespace". >>>> I'm waiting for an explanation how the dst entry which was moved to >>>> "a loopback device in that namespace" is released (i.e. what the >>>> expected shutdown sequence is). >>> >>> The most probable explanation is that we make sure the loopback device >>> is the last one to be dismantled at netns deletion, >>> and this would obviously happen after all dst have been released. >>> >> >> rt_flush_dev() becomes a no-op if "dev" == "a loopback device in that >> namespace". And according to debug printk(), rt_flush_dev() is called >> on "a loopback device in that namespace" itself. >> >> If "a loopback device in that namespace" is the last "one" (== "a network >> device in that namespace" ?), which shutdown sequence should have called >> dev_put("a loopback device in that namespace") before unregistration of >> "a loopback device in that namespace" starts? >> >> Since I'm not a netdev person, I appreciate if you can explain >> that shutdown sequence using a flow chart. >> > > The attached patch adds a tracepoint to notifier_call_chain. If you have > KALLSYMS enabled it will show the order of the function handlers: > > perf record -e notifier:* -a -g & > > ip netns del > > > fg > > > perf script > with the header file this time. --------------A130DC68AA00417E350956C2 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="0001-notifier-add-tracepoint-to-notifier_call_chain.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-notifier-add-tracepoint-to-notifier_call_chain.patch" RnJvbSBkZThiZmFlMDYwNmQ3NDg5MDhhNzBhNDM1ZmVlOWQ5Y2U1N2IxM2VhIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBBaGVybiA8ZHNhaGVybkBnbWFpbC5jb20+ CkRhdGU6IE1vbiwgMjkgQXByIDIwMTkgMTE6Mzg6NDkgLTA3MDAKU3ViamVjdDogW1BBVENI XSBub3RpZmllcjogYWRkIHRyYWNlcG9pbnQgdG8gbm90aWZpZXJfY2FsbF9jaGFpbgoKU2ln bmVkLW9mZi1ieTogRGF2aWQgQWhlcm4gPGRzYWhlcm5AZ21haWwuY29tPgotLS0KIGluY2x1 ZGUvdHJhY2UvZXZlbnRzL25vdGlmaWVyLmggfCA0OSArKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKwoga2VybmVsL25vdGlmaWVyLmMgICAgICAgICAgICAgICB8 ICAzICsrKwogMiBmaWxlcyBjaGFuZ2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GRhdGUuaD4KICNpbmNsdWRlIDxsaW51 eC92bWFsbG9jLmg+CiAjaW5jbHVkZSA8bGludXgvcmVib290Lmg+CisjZGVmaW5lIENSRUFU RV9UUkFDRV9QT0lOVFMKKyNpbmNsdWRlIDx0cmFjZS9ldmVudHMvbm90aWZpZXIuaD4KIAog LyoKICAqCU5vdGlmaWVyIGxpc3QgZm9yIGtlcm5lbCBjb2RlIHdoaWNoIHdhbnRzIHRvIGJl IGNhbGxlZApAQCAtOTAsNiArOTIsNyBAQCBzdGF0aWMgaW50IG5vdGlmaWVyX2NhbGxfY2hh aW4oc3RydWN0IG5vdGlmaWVyX2Jsb2NrICoqbmwsCiAJCQljb250aW51ZTsKIAkJfQogI2Vu ZGlmCisJCXRyYWNlX25vdGlmaWVyX2NhbGxfY2hhaW4obmIsIHZhbCk7CiAJCXJldCA9IG5i LT5ub3RpZmllcl9jYWxsKG5iLCB2YWwsIHYpOwogCiAJCWlmIChucl9jYWxscykKLS0gCjIu MTEuMAoK --------------A130DC68AA00417E350956C2--