public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: jwi@linux.vnet.ibm.com, netdev@vger.kernel.org,
	linux-s390@vger.kernel.org, heiko.carstens@de.ibm.com,
	raspl@linux.vnet.ibm.com, ubraun@linux.vnet.ibm.com
Subject: Re: [PATCH net-next 3/4] s390/diag: add diag26c support
Date: Wed, 21 Jun 2017 17:30:44 +0200	[thread overview]
Message-ID: <20170621173044.204bd2ca@mschwideX1> (raw)
In-Reply-To: <20170619.133743.1638444891079509192.davem@davemloft.net>

Hi Dave,

On Mon, 19 Jun 2017 13:37:43 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Date: Mon, 19 Jun 2017 17:34:25 +0200
> 
> > We (as in the s390 guys) tend to add __packed to hardware and hypervisor
> > structures even if the attribute is not strictly necessary. Most of the
> > diagnose related structures look that way. Dunno if it is worth to change
> > them.  
> 
> It causes gcc to generate bad code on certain platforms (yes, probably not
> yours) and is in general something to avoid.
> 
> Please do not use __packed unless absolutely necessary.
> 
> > The diag26c struct needs to be aligned on a doubleword boundary, the
> > __aligned(8) is necessary.  
> 
> That's fine.
> 
> > The __packed attribute is again superfluous but follows along the
> > lines of the other diag structures.  
> 
> Please remove it.

I looked at the various structures with the packed attribute in arch/s390
and found that we could remove a lot of them. As __packed also changes the
alignment of the structure removing the attribute from structures defined
in arch/s390/include/uapi/asm may cause trouble in user space. I stayed
away from the uapi headers.

For the rest of the code about 120 packed attributes could be removed, see:

https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git/log/?h=packed-cleanup

bloat-o-meter found only a few functions where the removal of packed
makes a difference (gcc 7.1.0):

add/remove: 1/1 grow/shrink: 8/7 up/down: 240/-308 (-68)
function                                     old     new   delta
pin_scb.isra                                   -     200    +200
stp_sync_clock                               982    1000     +18
stp_work_fn                                  416     420      +4
sca_ext_call_pending                         290     294      +4
kvm_arch_vcpu_create                        2008    2012      +4
get_vcpu_asce                               1206    1210      +4
hw_perf_event_update                        1738    1740      +2
clp_add_pci_device                          1400    1402      +2
__clp_rescan                                 162     164      +2
stp_timing_state_show                        138     134      -4
stp_timing_mode_show                         134     130      -4
stp_ctn_type_show                            134     130      -4
stp_time_offset_show                         150     144      -6
ccw_device_accumulate_irb                   1838    1832      -6
clp_misc_ioctl                              1142    1102     -40
timing_alert_interrupt                       158     114     -44
pin_scb                                      200       -    -200
Total: Before=155168810, After=155168742, chg -0.00%

The code gets minimally better. I am not convinced yet that this is worth
the hassle. These structures are architecture specific and the s390 CPUs
are perfectly fine with unaligned accesses.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

  reply	other threads:[~2017-06-21 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 11:22 [PATCH net-next 0/4] s390/net updates, part 2 Julian Wiedmann
2017-06-19 11:22 ` [PATCH net-next 1/4] s390/qeth: add ipa return codes for bridgeport Julian Wiedmann
2017-06-19 11:22 ` [PATCH net-next 2/4] s390/qeth: fix packing buffer statistics Julian Wiedmann
2017-06-19 11:22 ` [PATCH net-next 3/4] s390/diag: add diag26c support Julian Wiedmann
2017-06-19 14:47   ` David Miller
2017-06-19 15:34     ` Martin Schwidefsky
2017-06-19 17:37       ` David Miller
2017-06-21 15:30         ` Martin Schwidefsky [this message]
2017-06-19 11:22 ` [PATCH net-next 4/4] s390/qeth: use diag26c to get MAC address on L2 Julian Wiedmann
2017-06-19 14:48   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-06-20 14:00 [PATCH net-next 0/4] s390/net updates, part 2 (v2) Julian Wiedmann
2017-06-20 14:00 ` [PATCH net-next 3/4] s390/diag: add diag26c support Julian Wiedmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170621173044.204bd2ca@mschwideX1 \
    --to=schwidefsky@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jwi@linux.vnet.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raspl@linux.vnet.ibm.com \
    --cc=ubraun@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox