Received: by 10.223.185.116 with SMTP id b49csp4794587wrg; Wed, 7 Mar 2018 00:47:49 -0800 (PST) X-Google-Smtp-Source: AG47ELu3IK8ZEp2IUoQNVqg5Aqx+Yg/o+r3t4GGFdwVxZvRI8s1uYevW9ymE4yQ8SC52KPtO5wpR X-Received: by 10.98.110.71 with SMTP id j68mr21663509pfc.93.1520412469309; Wed, 07 Mar 2018 00:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520412468; cv=none; d=google.com; s=arc-20160816; b=qxrHIYuTZws/x0d01CIDTW10ElClQigbHo7uyOj4UNS9FFTe3+iKLAjEeAfhwA3K9u MipQrbkoy73h+rzslgagigxCMaHZkWIdQ0/Jmui8k3X+V+Oh2UYGxJpD6fbuL+CT5rZx PIj8ZN3K6xiX8xBgEE5vEhCQ+xoSOLovvuOo7MnQbyenDhdYDqFyqPM9AVlfvQQbs0BB nFtAEieAhppx572nbT02KDXyKYxL1EUxlH6REUFK+OluEg2n8syOydIe1aOEWc3uwEU5 ddxg/Ta25taRkyxfftgO6AzCUPrXkgVKuXYbFf5V6DgRaninpoIUjqWtWggLhiDlfFk6 RPXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=wpc5AEB96nXo+GmCMFxhVlhuSuZ6EfZUxxA6oDL37zg=; b=A6iFaxv9opSQ4i6tjfKuZ5ApZUcPQFORYcDsy3G3hCSjD/f20tx44Np8rdIzf5Z9R9 4SPl2Cneb050sUrot9Gt+7sW9PAX7YfWGk7dUeGfw3tMsA30iuGn/RsG6UDFhixGxEfb moi3VzdgnbXIkcYai4ZhYkKTP6EyWtGI9iGoP6m1XK+6xshmIEje8s4gJxvI+MI2tF1X By+JxvP2LzKVjibopSPEDFpT2NR2RBfjEEe6Dym5Z83aoBqzFaG9DX3PH48WptmvbaUU Emy++8RTA8QCB7haceugvPrNdePiGtWxfD1zb0ekO/KOOTmTLzY4e6llbpQ0D3zJrjk+ ShWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=jhV0ngzH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v15si11157224pgt.635.2018.03.07.00.47.34; Wed, 07 Mar 2018 00:47:48 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=jhV0ngzH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754159AbeCGIqg (ORCPT + 99 others); Wed, 7 Mar 2018 03:46:36 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:50814 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbeCGIqa (ORCPT ); Wed, 7 Mar 2018 03:46:30 -0500 Received: by mail-it0-f66.google.com with SMTP id d13so2387510itf.0 for ; Wed, 07 Mar 2018 00:46:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wpc5AEB96nXo+GmCMFxhVlhuSuZ6EfZUxxA6oDL37zg=; b=jhV0ngzHpLi8mHVfBR8n1Y3vE+KyHN2EhQFVypjeoLtbv+8Hp8oKOkzaS85WUz8EHl rOjcGaUir4w6/PJg3G2sBypsyGWMSfFAikPV9NmcrpG1FtdvFwd+PggbJCZOAgR5mpYr lMD44iM4hDLfcA4xF9YNYD/ijyN/sSbFouL85hNAFD3LfNMtSz9gVSsGp4/gXlssjyfk 4n5zus6h7TH5mDVfWV3FEqqgar9xidow2u/R+bGD/q3c8iypkKEdkyENO669fQL6vLgF QZY7DNamrjtrXVojq0iyoeIGVkRyVdlOGdJLhXcm6DJh2EKk0Uw1lB3mL/zQswNjSaVc YZFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wpc5AEB96nXo+GmCMFxhVlhuSuZ6EfZUxxA6oDL37zg=; b=jmj+PqCpG0pV69A2r0hPboecsfGpdir+yenn/ZDViIv0YnhC7eDAL/ljOBGFJHV8YN ygxyD64bkHRalClZ4v5e5qAaPPHJH4I2YGVfopu8gUDCLNFS4ocTFegiSmu7np4tmZfp UX99LoDuMzxnlRtRunJ8R3w4uOuFvm+gtJNGAOpOlATjJWt/kb4fjDI4K83lHJ1JH45y PZ3eYaZKDtXa5+602EZb70ibUhiVE/ZtK2nRI1hags5lwdq4w76c/yYlii9c7GVH3IXK qVhlyoAmXbsxICWVe0yLPPVYBRvpfRB6yTUsgkymNRokzYl3VMr5CUa4G0HT13pCvC3K 21jA== X-Gm-Message-State: AElRT7G23EpPzPN6ZQ+euB0Ib6QGNz1dVfjquB/PRUK+hP6fxPU1RFBD W6xRDVQpt4dZkn4OqRZvSLLF4St0YQlZDcmBirY= X-Received: by 10.36.221.212 with SMTP id t203mr21442963itf.54.1520412388971; Wed, 07 Mar 2018 00:46:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.34.71 with HTTP; Wed, 7 Mar 2018 00:46:27 -0800 (PST) In-Reply-To: <20180307022127.GB802@jagdpanzerIV> References: <20180305053742.9149-1-sergey.senozhatsky@gmail.com> <20180307022127.GB802@jagdpanzerIV> From: Arnd Bergmann Date: Wed, 7 Mar 2018 09:46:27 +0100 X-Google-Sender-Auth: E40iPK53N7olRssOv6vWGztDXmQ Message-ID: Subject: Re: [PATCH] dump_stack: convert generic dump_stack into a weak symbol To: Sergey Senozhatsky Cc: Petr Mladek , Tejun Heo , Steven Rostedt , Dave Young , Andi Kleen , Greentime Hu , Vincent Chen , Peter Zijlstra , Andrew Morton , Stephen Rothwell , adi-buildroot-devel@lists.sourceforge.net, Linux Kernel Mailing List , Sergey Senozhatsky Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 7, 2018 at 3:21 AM, Sergey Senozhatsky wrote: > Hello Arnd, > > On (03/06/18 14:27), Arnd Bergmann wrote: > [..] >> As we are now removing blackfin, based on the latest discussion, this >> part should no longer be necessary. > > When is this going to happen? 4.17? Originally I planned to wait a few more releases, but the last maintainer has commented that he will now send a patch for immediate removal, so 4.17 is almost certain at this point. > [..] >> nds32 currently only exists in linux-next, not in the mainline kernel. >> If it's the only architecture that does something different from everyone >> else, I think we should change nds32. >> >> I looked at the nds32 show_stack() implementation now and it >> seems to me that it is completely unnecessary, as the implementation >> from lib/dump_stack.c does basically the same thing (by calling >> show_stack(NULL, NULL)). > > Interesting point. I'll leave it to nds32 maintainers. > OTOH blackfin is still in linux-next, so I assume we need > that __weak dump_stack() for the time being. I did the review of all the nds32 patches, and would have commented on this if I had noticed it earlier. I see no reason not to change it, and would suggest that you continue under the assumption that nds32 is going to be fixed, leaving it up to Greentime to add a fix to his tree before he sends the pull request. >> > +asmlinkage __weak __visible void dump_stack(void) >> > { >> > __dump_stack(); >> > } >> >> Weak symbols are generally discouraged in the kernel. We have >> them in a couple of places, but I find them rather confusing as they >> make it harder to figure out what is actually going on. > > Honestly, I kind of find __weak less confusing than EXPORT_SYMBOL(dump_stack) > in 3 different places. __weak hints that the symbol likely will be overridden > somewhere, while EXPORT_SYMBOL() does not (at least not to me). Dunno. It's not either/or, they are both wrong ;-) The EXPORT_SYMBOL() is not the thing that makes it work. The duplicate declaration today only works because lib/dump_stack.o is listed as lib-y in the Makefile instead of obj-y. On blackfin and nds32, this causes the entire file to just not be included in the final vmlinux, because there are no references to it. With your patch, I would actually expect the lib/dump_stack.o file to still not be picked up, so now you have a missing EXPORT_SYMBOL() on the two unusual architectures until the point when you add another (referenced) symbol to it. Arnd