1. 03 Feb, 2018 2 commits
  2. 18 Nov, 2016 1 commit
    • Alexey Dobriyan's avatar
      netns: make struct pernet_operations::id unsigned int · c7d03a00
      Alexey Dobriyan authored
      
      
      Make struct pernet_operations::id unsigned.
      
      There are 2 reasons to do so:
      
      1)
      This field is really an index into an zero based array and
      thus is unsigned entity. Using negative value is out-of-bound
      access by definition.
      
      2)
      On x86_64 unsigned 32-bit data which are mixed with pointers
      via array indexing or offsets added or subtracted to pointers
      are preffered to signed 32-bit data.
      
      "int" being used as an array index needs to be sign-extended
      to 64-bit before being used.
      
      	void f(long *p, int i)
      	{
      		g(p[i]);
      	}
      
        roughly translates to
      
      	movsx	rsi, esi
      	mov	rdi, [rsi+...]
      	call 	g
      
      MOVSX is 3 byte instruction which isn't necessary if the variable is
      unsigned because x86_64 is zero extending by default.
      
      Now, there is net_generic() function which, you guessed it right, uses
      "int" as an array index:
      
      	static inline void *net_generic(const struct net *net, int id)
      	{
      		...
      		ptr = ng->ptr[id - 1];
      		...
      	}
      
      And this function is used a lot, so those sign extensions add up.
      
      Patch snipes ~1730 bytes on allyesconfig kernel (without all junk
      messing with code generation):
      
      	add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
      
      Unfortunately some functions actually grow bigger.
      This is a semmingly random artefact of code generation with register
      allocator being used differently. gcc decides that some variable
      needs to live in new r8+ registers and every access now requires REX
      prefix. Or it is shifted into r12, so [r12+0] addressing mode has to be
      used which is longer than [r8]
      
      However, overall balance is in negative direction:
      
      	add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
      	function                                     old     new   delta
      	nfsd4_lock                                  3886    3959     +73
      	tipc_link_build_proto_msg                   1096    1140     +44
      	mac80211_hwsim_new_radio                    2776    2808     +32
      	tipc_mon_rcv                                1032    1058     +26
      	svcauth_gss_legacy_init                     1413    1429     +16
      	tipc_bcbase_select_primary                   379     392     +13
      	nfsd4_exchange_id                           1247    1260     +13
      	nfsd4_setclientid_confirm                    782     793     +11
      		...
      	put_client_renew_locked                      494     480     -14
      	ip_set_sockfn_get                            730     716     -14
      	geneve_sock_add                              829     813     -16
      	nfsd4_sequence_done                          721     703     -18
      	nlmclnt_lookup_host                          708     686     -22
      	nfsd4_lockt                                 1085    1063     -22
      	nfs_get_client                              1077    1050     -27
      	tcf_bpf_init                                1106    1076     -30
      	nfsd4_encode_fattr                          5997    5930     -67
      	Total: Before=154856051, After=154854321, chg -0.00%
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7d03a00
  3. 13 Aug, 2015 1 commit
  4. 17 Sep, 2014 1 commit
  5. 12 Jul, 2014 1 commit
  6. 13 Feb, 2013 1 commit
    • Eric W. Biederman's avatar
      nfs_common: Update the translation between nfsv3 acls linux posix acls · ddca4e17
      Eric W. Biederman authored
      
      
      - Use kuid_t and kgit in struct nfsacl_encode_desc.
      - Convert from kuids and kgids when generating on the wire values.
      - Convert on the wire values to kuids and kgids when read.
      - Modify cmp_acl_entry to be type safe comparison on posix acls.
        Only acls with type ACL_USER and ACL_GROUP can appear more
        than once and as such need to compare more than their tag.
      - The e_id field is being removed from posix acls so don't initialize it.
      
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      ddca4e17
  7. 31 Mar, 2011 1 commit
  8. 23 Mar, 2011 1 commit
  9. 25 Jan, 2011 2 commits
  10. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        bloc...
      5a0e3ad6
  11. 23 Dec, 2008 1 commit
  12. 20 Oct, 2006 1 commit
  13. 11 Oct, 2005 1 commit
    • Andreas Gruenbacher's avatar
      [PATCH] nfsacl: Solaris VxFS compatibility fix · 22c1ea44
      Andreas Gruenbacher authored
      
      
      Here is a compatibility fix between Linux and Solaris when used with VxFS
      filesystems: Solaris usually accepts acl entries in any order, but with
      VxFS it replies with NFSERR_INVAL when it sees a four-entry acl that is not
      in canonical form.  It may also fail with other non-canonical acls -- I
      can't tell, because that case never triggers: We only send non-canonical
      acls when we fake up an ACL_MASK entry.
      
      Instead of adding fake ACL_MASK entries at the end, inserting them in the
      correct position makes Solaris+VxFS happy.  The Linux client and server
      sides don't care about entry order.  The three-entry-acl special case in
      which we need a fake ACL_MASK entry was handled in xdr_nfsace_encode.  The
      patch moves this into nfsacl_encode.
      Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
      Acked-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      22c1ea44
  14. 16 Aug, 2005 1 commit
  15. 22 Jun, 2005 1 commit