From owner-svn-src-all@freebsd.org Sat Oct 26 08:27:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E6DE1650DE; Sat, 26 Oct 2019 08:27:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 470YxM64qrz3Pjp; Sat, 26 Oct 2019 08:27:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x9Q8Qt1H023601 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 26 Oct 2019 11:26:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x9Q8Qt1H023601 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x9Q8Qtoc023600; Sat, 26 Oct 2019 11:26:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Oct 2019 11:26:55 +0300 From: Konstantin Belousov To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Gerald Pfeifer Subject: Re: svn commit: r354095 - in head/sys: amd64/amd64 amd64/include kern Message-ID: <20191026082655.GJ73312@kib.kiev.ua> References: <201910252009.x9PK9gIV092660@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 470YxM64qrz3Pjp X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2019 08:27:04 -0000 On Sat, Oct 26, 2019 at 08:24:09AM +0200, Antoine Brodin wrote: > On Fri, Oct 25, 2019 at 10:09 PM Konstantin Belousov wrote: > > > > Author: kib > > Date: Fri Oct 25 20:09:42 2019 > > New Revision: 354095 > > URL: https://svnweb.freebsd.org/changeset/base/354095 > > > > Log: > > amd64: move pcb out of kstack to struct thread. > > > > This saves 320 bytes of the precious stack space. > > > > The only negative aspect of the change I can think of is that the > > struct thread increased by 320 bytes obviously, and that 320 bytes are > > not swapped out anymore. I believe the freed stack space is much more > > important than that. Also, current struct thread size is 1392 bytes > > on amd64, so UMA will allocate two thread structures per (4KB) slab, > > which leaves a space for pcb without increasing zone memory use. > > > > Reviewed by: alc, markj > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Differential revision: https://reviews.freebsd.org/D22138 > > Hi, > > It seems that this breaks at least some versions of gcc: > > In file included from /usr/include/sys/proc.h:75, > from /usr/include/sys/user.h:51, > from ./md-unwind-support.h:34, > from > /wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20191020/libgcc/unwind-dw2.c:412: > /usr/include/machine/proc.h:76:13: error: field 'md_pcb' has incomplete type > 76 | struct pcb md_pcb; > | ^~~~~~ > It is very strange. Are gcc 9 or 8 affected ? As a blind guess, please try this patch. diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h index 44e34fa5c83..9758e684da2 100644 --- a/sys/amd64/include/pcb.h +++ b/sys/amd64/include/pcb.h @@ -45,7 +45,7 @@ #include #include -#ifdef __amd64__ +#if defined(__amd64__) || defined(__x86_64__) /* * NB: The fields marked with (*) are used by kernel debuggers. Their * ABI should be preserved.