Received: by 10.192.165.156 with SMTP id m28csp1178720imm; Mon, 16 Apr 2018 15:44:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/cgN46Pr0+D16lqPYuHB7rjsfBhbvPy9eJrToLf8MDnPnq8ffzHNuxRzxdlIMitHqsxhv2 X-Received: by 10.101.92.139 with SMTP id a11mr2659373pgt.204.1523918655513; Mon, 16 Apr 2018 15:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523918655; cv=none; d=google.com; s=arc-20160816; b=ZUyQAP8mzg9sKjMfsvS6N3lcoCCIK2NXmJWupH4yu0hmgp44kfV01s+gPkx2iIp11B csVyoSIzEV3Y+Uyn0kdmJBnCxNjfE8Qs8qXobiw3zp4EGpEyxT0UWacc8+qBm3vXNx4L bwc8X+OzzhU3lmQlT4jn9on/X7AEnkCUOnjYU2oVCb5o01bKL/fknZHuePscj4aCYvC1 V9pqaJY5q2xP3ZABXI2L+r+cyqPk19bQmCe+9u0A+BjUufqmGPcpsbl/+7qVtKdgFNtV /FKr1IyjDEreMb3xE6ECNaKiamx96X3WpI+hYs+AMkOPIkVRfa9v+Q64I3WjMr0qZxLh DNiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=dORNuS2fE5IcpqlVz2cYz4L8Vp+EAWgFBDA4eJvTXbI=; b=HiZ2Onq71TYuRln+XWV4GHaN4NyatwhlrGTDy/6hJMvFzJiAhoVdzFLRd1C+dHEGda Nn61baUKfspXspwIkaXc40PK1HLCybAiIJbt8GKCrZtbwQaqsyAn6QEUmo+QO37kGrXT dqRIB3Nv0fh72vBpVBRDUta4HvFvAn/L1xc0JWap+0rAeD+DPmNhlF3TaOMQodQz9mZs 59mcRewUB4qRniHAKPtQ75ChqFBZmzTDHE49MPR/91N7SDNynaP/mPLmCWhMlT4nt0Qc YccQVhrP5B3jmebGEleNj7pResVh1xGwMHZTUOQeNZE37wgzTTJLvv4/p4BKDGBDUPET GIPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=N4TPdnzS; 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 be3-v6si12207756plb.75.2018.04.16.15.44.01; Mon, 16 Apr 2018 15:44:15 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=N4TPdnzS; 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 S1753031AbeDPWmq (ORCPT + 99 others); Mon, 16 Apr 2018 18:42:46 -0400 Received: from casper.infradead.org ([85.118.1.10]:38056 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752916AbeDPWmo (ORCPT ); Mon, 16 Apr 2018 18:42:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Message-ID:In-Reply-To:Subject:cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dORNuS2fE5IcpqlVz2cYz4L8Vp+EAWgFBDA4eJvTXbI=; b=N4TPdnzSObCnTqRDKERMFr1Y0 X+yw0sRsA61w1Nwb652whpPOmKkjZRWRdCu7Jy+d1W8rUgvwYampAgNvBuO4NjLHzwE8Hb6y3OfW2 3uR7hymqb51YwNbV844Ygn0JGj+onlr7Q+WZtw8BHkizeRQ6Iaama4CUc2VoSlHF7R40ma7Bcgu+T rWiQsZJLdcL1yelxSVx2Z5A782J++ddNt9XG9O+h6j+2UqJs68Q/C1bZYGn0CNwSeFR3ZfOQjGR6q wEN16vZcN776j8C6MnzXkDOacXswO4PrxljJgqYzXzCSMTRP7UGM4SP2NGtfOarYLJZV9/xLhRfO2 QihT/1v8g==; Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8CpT-0004Ak-VM; Mon, 16 Apr 2018 22:42:33 +0000 Date: Mon, 16 Apr 2018 23:42:31 +0100 (BST) From: James Simmons To: Patrick Farrell cc: NeilBrown , Oleg Drokin , Greg Kroah-Hartman , Linux Kernel Mailing List , Lustre Development List Subject: Re: [lustre-devel] [PATCH 1/6] staging: lustre: move stack-check macros to libcfs_debug.h In-Reply-To: <6D3C7935-E7ED-4826-B459-0C4888D6048E@cray.com> Message-ID: References: <152383910760.23409.2327082725637657049.stgit@noble> <152383935730.23409.6748888065027051683.stgit@noble> <6D3C7935-E7ED-4826-B459-0C4888D6048E@cray.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1985284609-449751960-1523918551=:14398" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180416_234232_023958_AB89EC60 X-CRM114-Status: GOOD ( 35.10 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1985284609-449751960-1523918551=:14398 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT > James, > > If I understand correctly, you're saying you want to be able to build without debug support...? I'm not convinced that building a client without debug support is interesting or useful. In fact, I think it would be harmful, and we shouldn't open up the possibility - this is switchable debug with very low overhead when not actually "on". It would be really awful to get a problem on a running system and discover there's no debug support - that you can't even enable debug without a reinstall. > > If I've understood you correctly, then I would want to see proof of a significant performance cost when debug is built but *off* before agreeing to even exposing this option. (I know it's a choice they'd have to make, but if it's not really useful with a side order of potentially harmful, we shouldn't even give people the choice.) I'm not saying add the option today but this is more for the long game. While the Intel lustre developers deeply love lustre's debugging infrastructure I see a future where something better will come along to replace it. When that day comes we will have a period where both debugging infrastructurs will exist and some deployers of lustre will want to turn off the old debugging infrastructure and just use the new. That is what I have in mind. A switch to flip between options. > - Patrick > > On 4/15/18, 10:49 PM, "lustre-devel on behalf of James Simmons" wrote: > > > > CDEBUG_STACK() and CHECK_STACK() are macros to help with > > debugging, so move them from > > drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h > > to > > drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h > > > > This seems a more fitting location, and is a step towards > > removing linux/libcfs.h and simplifying the include file structure. > > Nak. Currently the lustre client always enables debugging but that > shouldn't be the case. What we do need is the able to turn off the > crazy debugging stuff. In the development branch of lustre it is > done with CDEBUG_ENABLED. We need something like that in Kconfig > much like we have CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK. Since we like > to be able to turn that off this should be moved to just after > LIBCFS_DEBUG_MSG_DATA_DECL. Then from CHECK_STACK down to CWARN() > it can be build out. When CDEBUG_ENABLED is disabled CDEBUG_LIMIT > would be empty. > > > Signed-off-by: NeilBrown > > --- > > .../lustre/include/linux/libcfs/libcfs_debug.h | 32 ++++++++++++++++++++ > > .../lustre/include/linux/libcfs/linux/libcfs.h | 31 ------------------- > > 2 files changed, 32 insertions(+), 31 deletions(-) > > > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h > > index 9290a19429e7..0dc7b91efe7c 100644 > > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h > > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h > > @@ -62,6 +62,38 @@ int libcfs_debug_str2mask(int *mask, const char *str, int is_subsys); > > extern unsigned int libcfs_catastrophe; > > extern unsigned int libcfs_panic_on_lbug; > > > > +/* Enable debug-checks on stack size - except on x86_64 */ > > +#if !defined(__x86_64__) > > +# ifdef __ia64__ > > +# define CDEBUG_STACK() (THREAD_SIZE - \ > > + ((unsigned long)__builtin_dwarf_cfa() & \ > > + (THREAD_SIZE - 1))) > > +# else > > +# define CDEBUG_STACK() (THREAD_SIZE - \ > > + ((unsigned long)__builtin_frame_address(0) & \ > > + (THREAD_SIZE - 1))) > > +# endif /* __ia64__ */ > > + > > +#define __CHECK_STACK(msgdata, mask, cdls) \ > > +do { \ > > + if (unlikely(CDEBUG_STACK() > libcfs_stack)) { \ > > + LIBCFS_DEBUG_MSG_DATA_INIT(msgdata, D_WARNING, NULL); \ > > + libcfs_stack = CDEBUG_STACK(); \ > > + libcfs_debug_msg(msgdata, \ > > + "maximum lustre stack %lu\n", \ > > + CDEBUG_STACK()); \ > > + (msgdata)->msg_mask = mask; \ > > + (msgdata)->msg_cdls = cdls; \ > > + dump_stack(); \ > > + /*panic("LBUG");*/ \ > > + } \ > > +} while (0) > > +#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls) > > +#else /* __x86_64__ */ > > +#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while (0) > > +#define CDEBUG_STACK() (0L) > > +#endif /* __x86_64__ */ > > + > > #ifndef DEBUG_SUBSYSTEM > > # define DEBUG_SUBSYSTEM S_UNDEFINED > > #endif > > diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h > > index 07d3cb2217d1..83aec9c7698f 100644 > > --- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h > > +++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h > > @@ -80,35 +80,4 @@ > > #include > > #include "linux-cpu.h" > > > > -#if !defined(__x86_64__) > > -# ifdef __ia64__ > > -# define CDEBUG_STACK() (THREAD_SIZE - \ > > - ((unsigned long)__builtin_dwarf_cfa() & \ > > - (THREAD_SIZE - 1))) > > -# else > > -# define CDEBUG_STACK() (THREAD_SIZE - \ > > - ((unsigned long)__builtin_frame_address(0) & \ > > - (THREAD_SIZE - 1))) > > -# endif /* __ia64__ */ > > - > > -#define __CHECK_STACK(msgdata, mask, cdls) \ > > -do { \ > > - if (unlikely(CDEBUG_STACK() > libcfs_stack)) { \ > > - LIBCFS_DEBUG_MSG_DATA_INIT(msgdata, D_WARNING, NULL); \ > > - libcfs_stack = CDEBUG_STACK(); \ > > - libcfs_debug_msg(msgdata, \ > > - "maximum lustre stack %lu\n", \ > > - CDEBUG_STACK()); \ > > - (msgdata)->msg_mask = mask; \ > > - (msgdata)->msg_cdls = cdls; \ > > - dump_stack(); \ > > - /*panic("LBUG");*/ \ > > - } \ > > -} while (0) > > -#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls) > > -#else /* __x86_64__ */ > > -#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while (0) > > -#define CDEBUG_STACK() (0L) > > -#endif /* __x86_64__ */ > > - > > #endif /* _LINUX_LIBCFS_H */ > > > > > > > _______________________________________________ > lustre-devel mailing list > lustre-devel@lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > > > --1985284609-449751960-1523918551=:14398--