From owner-svn-src-all@freebsd.org Sat Oct 26 12:16:33 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 C588D16F891; Sat, 26 Oct 2019 12:16:33 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470g285r3bz45w7; Sat, 26 Oct 2019 12:16:32 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qt1-f194.google.com with SMTP id y39so2169410qty.0; Sat, 26 Oct 2019 05:16:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lol3MMf7s/sjVmbpieHfsCoGPRSQUqLuyPvXpqjKTMk=; b=mrznCoUZdEZK3eacliEcKZ6V5TRzabi/e+bMcvgsze3/XVA/X7LSdCG1qO6wzkzqob G/s7Fv01qWlPdWMnNPwxnKoUIIiNDdhDfDmwhxfoCBrpqBW+5xsJUfFuP+jX6G4vLtxP qHCCvYkou8WO8LwA94OmeVtBBZZOD60sC1f60wypwE/DidujN25y/Cw3tOHmmn81mU5m vgDt2+DuRYhYfJpQo7fQXnRdHgmfwIOOfKK0fd/o3i4yfCCGLRGmeK0FSIOmG5qxDaJo HRs/wnhv50kSlZLv493tLUYeVO+z3e5bfshOnBeblfrZ3TsznHqw8wwDWGOS6rAQM1XM IVrQ== X-Gm-Message-State: APjAAAU2KrGShGSeFWV/UOvuCuA/mWl6sq52JlxumzNQP2MNUsVooE6m 9qh4HsAWkNRys/40VxuN//XzdL2mGRjT+AvXCJ8= X-Google-Smtp-Source: APXvYqwkWLBh/z51XdZxK3LAyWoI8mMobkmtbmNH6bnRtOiUuk4rTEyd9cEW70Nzx/IeiC3ghawNFoFyHG0mYlXX6NU= X-Received: by 2002:ac8:1413:: with SMTP id k19mr8316578qtj.360.1572092191288; Sat, 26 Oct 2019 05:16:31 -0700 (PDT) MIME-Version: 1.0 References: <201910252009.x9PK9gIV092660@repo.freebsd.org> <20191026082655.GJ73312@kib.kiev.ua> In-Reply-To: <20191026082655.GJ73312@kib.kiev.ua> From: Antoine Brodin Date: Sat, 26 Oct 2019 14:16:19 +0200 Message-ID: Subject: Re: svn commit: r354095 - in head/sys: amd64/amd64 amd64/include kern To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Gerald Pfeifer Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 470g285r3bz45w7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of antoinebrodinfreebsd@gmail.com designates 209.85.160.194 as permitted sender) smtp.mailfrom=antoinebrodinfreebsd@gmail.com X-Spamd-Result: default: False [-4.14 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[194.160.85.209.rep.mailspike.net : 127.0.0.18]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.160.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.14)[ip: (-5.40), ipnet: 209.85.128.0/17(-3.22), asn: 15169(-2.05), country: US(-0.05)]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] 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 12:16:33 -0000 On Sat, Oct 26, 2019 at 10:27 AM Konstantin Belousov wrote: > 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 ? gcc 8 and 9 are affected too. > 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. I will test this. Antoine