1. 01 Apr, 2012 6 commits
    • Tejun Heo's avatar
      cgroup: relocate cftype and cgroup_subsys definitions in controllers · 676f7c8f
      Tejun Heo authored
      blk-cgroup, netprio_cgroup, cls_cgroup and tcp_memcontrol
      unnecessarily define cftype array and cgroup_subsys structures at the
      top of the file, which is unconventional and necessiates forward
      declaration of methods.
      This patch relocates those below the definitions of the methods and
      removes the forward declarations.  Note that forward declaration of
      tcp_files[] is added in tcp_memcontrol.c for tcp_init_cgroup().  This
      will be removed soon by another patch.
      This patch doesn't introduce any functional change.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    • Tejun Heo's avatar
      cgroup: merge cft_release_agent cftype array into the base files array · 6e6ff25b
      Tejun Heo authored
      Now that cftype can express whether a file should only be on root,
      cft_release_agent can be merged into the base files cftypes array.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    • Tejun Heo's avatar
      cgroup: implement cgroup_add_cftypes() and friends · 8e3f6541
      Tejun Heo authored
      Currently, cgroup directories are populated by subsys->populate()
      callback explicitly creating files on each cgroup creation.  This
      level of flexibility isn't needed or desirable.  It provides largely
      unused flexibility which call for abuses while severely limiting what
      the core layer can do through the lack of structure and conventions.
      Per each cgroup file type, the only distinction that cgroup users is
      making is whether a cgroup is root or not, which can easily be
      expressed with flags.
      This patch introduces cgroup_add_cftypes().  These deal with cftypes
      instead of individual files - controllers indicate that certain types
      of files exist for certain subsystem.  Newly added CFTYPE_*_ON_ROOT
      flags indicate whether a cftype should be excluded or created only on
      the root cgroup.
      cgroup_add_cftypes() can be called any time whether the target
      subsystem is currently attached or not.  cgroup core will create files
      on the existing cgroups as necessary.
      Also, cgroup_subsys->base_cftypes is added to ease registration of the
      base files for the subsystem.  If non-NULL on subsys init, the cftypes
      pointed to by ->base_cftypes are automatically registered on subsys
      init / load.
      Further patches will convert the existing users and remove the file
      based interface.  Note that this interface allows dynamic addition of
      files to an active controller.  This will be used for sub-controller
      modularity and unified hierarchy in the longer term.
      This patch implements the new mechanism but doesn't apply it to any
      v2: replaced DECLARE_CGROUP_CFTYPES[_COND]() with
          cgroup_subsys->base_cftypes, which works better for cgroup_subsys
          which is loaded as module.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    • Tejun Heo's avatar
      cgroup: build list of all cgroups under a given cgroupfs_root · b0ca5a84
      Tejun Heo authored
      Build a list of all cgroups anchored at cgroupfs_root->allcg_list and
      going through cgroup->allcg_node.  The list is protected by
      cgroup_mutex and will be used to improve cgroup file handling.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    • Tejun Heo's avatar
      cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir() · ff4c8d50
      Tejun Heo authored
      cgroup_populate_dir() currently clears all files and then repopulate
      the directory; however, the clearing part is only useful when it's
      called from cgroup_remount().  Relocate the invocation to
      This is to prepare for further cgroup file handling updates.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    • Tejun Heo's avatar
      cgroup: deprecate remount option changes · 8b5a5a9d
      Tejun Heo authored
      This patch marks the following features for deprecation.
      * Rebinding subsys by remount: Never reached useful state - only works
        on empty hierarchies.
      * release_agent update by remount: release_agent itself will be
        replaced with conventional fsnotify notification.
      v2: Lennart pointed out that "name=" is necessary for mounts w/o any
          controller attached.  Drop "name=" deprecation.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Lennart Poettering <mzxreary@0pointer.de>
  2. 31 Mar, 2012 34 commits
    • Linus Torvalds's avatar
      Linux 3.4-rc1 · dd775ae2
      Linus Torvalds authored
    • Linus Torvalds's avatar
      Merge branch 's3-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/amit/virtio-console · b7ffff4b
      Linus Torvalds authored
      Pull virtio S3 support patches from Amit Shah:
       "Turns out S3 is not different from S4 for virtio devices: the device
        is assumed to be reset, so the host and guest state are to be assumed
        to be out of sync upon resume.  We handle the S4 case with exactly the
        same scenario, so just point the suspend/resume routines to the
        freeze/restore ones.
        Once that is done, we also use the PM API's macro to initialise the
        sleep functions.
        A couple of cleanups are included: there's no need for special thaw
        processing in the balloon driver, so that's addressed in patches 1 and
        Testing: both S3 and S4 support have been tested using these patches
        using a similar method used earlier during S4 patch development: a
        guest is started with virtio-blk as the only disk, a virtio network
        card, a virtio-serial port and a virtio balloon device.  Ping from
        guest to host, dd /dev/zero to a file on the disk, and IO from the
        host on the virtio-serial port, all at once, while exercising S4 and
        S3 (separately) were tested.  They all continue to work fine after
        resume.  virtio balloon values too were tested by inflating and
        deflating the balloon."
      Pulling from Amit, since Rusty is off getting married (and presumably
      shaving people).
      * 's3-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/amit/virtio-console:
        virtio-pci: switch to PM ops macro to initialise PM functions
        virtio-pci: S3 support
        virtio-pci: drop restore_common()
        virtio: drop thaw PM operation
        virtio: balloon: Allow stats update after restore from S4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 8bb1f229
      Linus Torvalds authored
      Pull second try at vfs part d#2 from Al Viro:
       "Miklos' first series (with do_lookup() rewrite split into edible
        chunks) + assorted bits and pieces.
        The 'untangling of do_lookup()' series is is a splitup of what used to
        be a monolithic patch from Miklos, so this series is basically "how do
        I convince myself that his patch is correct (or find a hole in it)".
        No holes found and I like the resulting cleanup, so in it went..."
      Changes from try 1: Fix a boot problem with selinux, and commit messages
      prettied up a bit.
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (24 commits)
        vfs: fix out-of-date dentry_unhash() comment
        vfs: split __lookup_hash
        untangling do_lookup() - take __lookup_hash()-calling case out of line.
        untangling do_lookup() - switch to calling __lookup_hash()
        untangling do_lookup() - merge d_alloc_and_lookup() callers
        untangling do_lookup() - merge failure exits in !dentry case
        untangling do_lookup() - massage !dentry case towards __lookup_hash()
        untangling do_lookup() - get rid of need_reval in !dentry case
        untangling do_lookup() - eliminate a loop.
        untangling do_lookup() - expand the area under ->i_mutex
        untangling do_lookup() - isolate !dentry stuff from the rest of it.
        vfs: move MAY_EXEC check from __lookup_hash()
        vfs: don't revalidate just looked up dentry
        vfs: fix d_need_lookup/d_revalidate order in do_lookup
        ext3: move headers to fs/ext3/
        migrate ext2_fs.h guts to fs/ext2/ext2.h
        new helper: ext2_image_size()
        get rid of pointless includes of ext2_fs.h
        ext2: No longer export ext2_fs.h to user space
        mtdchar: kill persistently held vfsmount
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f22e08a7
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar.
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
        sched: Fix __schedule_bug() output when called from an interrupt
        sched/arch: Introduce the finish_arch_post_lock_switch() scheduler callback
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f187e9fd
      Linus Torvalds authored
      Pull perf updates and fixes from Ingo Molnar:
       "It's mostly fixes, but there's also two late items:
         - preliminary GTK GUI support for perf report
         - PMU raw event format descriptors in sysfs, to be parsed by tooling
        The raw event format in sysfs is a new ABI.  For example for the 'CPU'
        PMU we have:
          aldebaran:~> ll /sys/bus/event_source/devices/cpu/format/*
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/any
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/cmask
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/edge
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/event
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/inv
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/offcore_rsp
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/pc
          -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/umask
        those lists of fields contain a specific format:
          aldebaran:~> cat /sys/bus/event_source/devices/cpu/format/offcore_rsp
        So, those who wish to specify raw events can now use the following
        event format:
          -e cpu/cmask=1,event=2,umask=3
        Most people will not want to specify any events (let alone raw
        events), they'll just use whatever default event the tools use.
        But for more obscure PMU events that have no cross-architecture
        generic events the above syntax is more usable and a bit more
        structured than specifying hex numbers."
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
        perf tools: Remove auto-generated bison/flex files
        perf annotate: Fix off by one symbol hist size allocation and hit accounting
        perf tools: Add missing ref-cycles event back to event parser
        perf annotate: addr2line wants addresses in same format as objdump
        perf probe: Finder fails to resolve function name to address
        tracing: Fix ent_size in trace output
        perf symbols: Handle NULL dso in dso__name_len
        perf symbols: Do not include libgen.h
        perf tools: Fix bug in raw sample parsing
        perf tools: Fix display of first level of callchains
        perf tools: Switch module.h into export.h
        perf: Move mmap page data_head offset assertion out of header
        perf: Fix mmap_page capabilities and docs
        perf diff: Fix to work with new hists design
        perf tools: Fix modifier to be applied on correct events
        perf tools: Fix various casting issues for 32 bits
        perf tools: Simplify event_read_id exit path
        tracing: Fix ftrace stack trace entries
        tracing: Move the tracing_on/off() declarations into CONFIG_TRACING
        perf report: Add a simple GTK2-based 'perf report' browser
    • Linus Torvalds's avatar
      Merge tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6 · adb3b1f3
      Linus Torvalds authored
      Pull PARISC misc updates from James Bottomley:
       "This is a couple of minor updates (fixing lws futex locking and
        removing some obsolete cpu_*_map calls)."
      * tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6:
        [PARISC] remove references to cpu_*_map.
        [PARISC] futex: Use same lock set as lws calls
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 · a75ee6ec
      Linus Torvalds authored
      Pull SCSI updates from James Bottomley:
       "This is primarily another round of driver updates (lpfc, bfa, fcoe,
        ipr) plus a new ufshcd driver.  There shouldn't be anything
        controversial in here (The final deletion of scsi proc_ops which
        caused some build breakage has been held over until the next merge
        window to give us more time to stabilise it).
        I'm afraid, with me moving continents at exactly the wrong time,
        anything submitted after the merge window opened has been held over to
        the next merge window."
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (63 commits)
        [SCSI] ipr: Driver version 2.5.3
        [SCSI] ipr: Increase alignment boundary of command blocks
        [SCSI] ipr: Increase max concurrent oustanding commands
        [SCSI] ipr: Remove unnecessary memory barriers
        [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters
        [SCSI] ipr: Fix target id allocation re-use problem
        [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
        [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
        [SCSI] bfa: Update the driver version to
        [SCSI] bfa: BSG and User interface fixes.
        [SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.
        [SCSI] bfa: Move service parameter programming logic into firmware.
        [SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
        [SCSI] bfa: Flash controller IOC pll init fixes.
        [SCSI] bfa: Serialize the IOC hw semaphore unlock logic.
        [SCSI] bfa: Modify ISR to process pending completions
        [SCSI] bfa: Add fc host issue lip support
        [SCSI] mpt2sas: remove extraneous sas_log_info messages
        [SCSI] libfc: fcoe_transport_create fails in single-CPU environment
        [SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]
    • J. Bruce Fields's avatar
      vfs: fix out-of-date dentry_unhash() comment · c0d02594
      J. Bruce Fields authored
       "vfs: remove dget() from
      dentry_unhash()" changed the implementation but not the comment.
      Cc: Sage Weil <sage@newdream.net>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Miklos Szeredi's avatar
      vfs: split __lookup_hash · bad61189
      Miklos Szeredi authored
      Split __lookup_hash into two component functions:
       lookup_dcache - tries cached lookup, returns whether real lookup is needed
       lookup_real - calls i_op->lookup
      This eliminates code duplication between d_alloc_and_lookup() and
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
    • Al Viro's avatar
      untangling do_lookup() - switch to calling __lookup_hash() · a3255546
      Al Viro authored
      now we have __lookup_hash() open-coded if !dentry case;
      just call the damn thing instead...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
    • Al Viro's avatar
    • Al Viro's avatar
      untangling do_lookup() - massage !dentry case towards __lookup_hash() · d774a058
      Al Viro authored
      Reorder if-else cases for starters...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      untangling do_lookup() - get rid of need_reval in !dentry case · 08b0ab7c
      Al Viro authored
      Everything arriving into if (!dentry) will have need_reval = 1.
      Indeed, the only way to get there with need_reval reset to 0 would
      be via
      	if (unlikely(d_need_lookup(dentry)))
      		goto unlazy;
      	if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
      		status = d_revalidate(dentry, nd);
      	if (unlikely(status <= 0)) {
      		if (status != -ECHILD)
      			need_reval = 0;
      		goto unlazy;
      	/* no assignments to dentry */
      	if (dentry && unlikely(d_need_lookup(dentry))) {
      		dentry = NULL;
      and if d_need_lookup() had already been false the first time around, it
      will remain false on the second call as well.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      untangling do_lookup() - eliminate a loop. · acc9cb3c
      Al Viro authored
      d_lookup() *will* fail after successful d_invalidate(), if we are
      holding i_mutex all along.  IOW, we don't need to jump back to
      l: - we know what path will be taken there and can do that (i.e.
      d_alloc_and_lookup()) directly.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      untangling do_lookup() - expand the area under ->i_mutex · 37c17e1f
      Al Viro authored
      keep holding ->i_mutex over revalidation parts
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      untangling do_lookup() - isolate !dentry stuff from the rest of it. · 3f6c7c71
      Al Viro authored
      Duplicate the revalidation-related parts into if (!dentry) branch.
      Next step will be to pull them under i_mutex.
      This and the next 8 commits are more or less a splitup of patch
      by Miklos; folks, when you are working with something that convoluted,
      carve your patches up into easily reviewed steps, especially when
      a lot of codepaths involved are rarely hit...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Miklos Szeredi's avatar
      vfs: move MAY_EXEC check from __lookup_hash() · cda309de
      Miklos Szeredi authored
      The only caller of __lookup_hash() that needs the exec permission check on
      parent is lookup_one_len().
      All lookup_hash() callers already checked permission in LOOKUP_PARENT walk.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Miklos Szeredi's avatar
      vfs: don't revalidate just looked up dentry · 3637c05d
      Miklos Szeredi authored
      __lookup_hash() calls ->lookup() if the dentry needs lookup and on success
      revalidates the dentry (all under dir->i_mutex).
      While this is harmless it doesn't make a lot of sense.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Miklos Szeredi's avatar
      vfs: fix d_need_lookup/d_revalidate order in do_lookup · fa4ee159
      Miklos Szeredi authored
      Doing revalidate on a dentry which has not yet been looked up makes no sense.
      Move the d_need_lookup() check before d_revalidate().
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      ext3: move headers to fs/ext3/ · 4613ad18
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      migrate ext2_fs.h guts to fs/ext2/ext2.h · f7699f2b
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      new helper: ext2_image_size() · 39429c5e
      Al Viro authored
      ... implemented that way since the next commit will leave it
      almost alone in ext2_fs.h - most of the file (including
      struct ext2_super_block) is going to move to fs/ext2/ext2.h.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      get rid of pointless includes of ext2_fs.h · 2f99c369
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Thierry Reding's avatar
      ext2: No longer export ext2_fs.h to user space · 4a165d25
      Thierry Reding authored
      Since the on-disk format has been stable for quite some time, users
      should either use the headers provided by libext2fs or keep a private
      copy of this header. For the full discussion, see this thread:
      While at it, this commit removes all __KERNEL__ guards, which are now
      Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Ted Ts'o <tytso@mit.edu>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: Andreas Dilger <aedilger@gmail.com>
      Cc: linux-ext4@vger.kernel.org
    • Al Viro's avatar
      mtdchar: kill persistently held vfsmount · 00292bbf
      Al Viro authored
      ... and mtdchar_notifier along with it; just have ->drop_inode() that
      will unconditionally get evict them instead of dances on mtd device
      removal and use simple_pin_fs() instead of kern_mount()
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      pstore: trim pstore_get_inode() · 22a71c30
      Al Viro authored
      move mode-dependent parts to callers, kill unused arguments
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
    • Al Viro's avatar
    • Al Viro's avatar
    • Matthew Garrett's avatar
      ASPM: Fix pcie devices with non-pcie children · c9651e70
      Matthew Garrett authored
      Since 3.2.12 and 3.3, some systems are failing to boot with a BUG_ON.
      Some other systems using the pata_jmicron driver fail to boot because no
      disks are detected.  Passing pcie_aspm=force on the kernel command line
      works around it.
      The cause: commit 4949be16 ("PCI: ignore pre-1.1 ASPM quirking when
      ASPM is disabled") changed the behaviour of pcie_aspm_sanity_check() to
      always return 0 if aspm is disabled, in order to avoid cases where we
      changed ASPM state on pre-PCIe 1.1 devices.
      This skipped the secondary function of pcie_aspm_sanity_check which was
      to avoid us enabling ASPM on devices that had non-PCIe children, causing
      trouble later on.  Move the aspm_disabled check so we continue to honour
      that scenario.
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42979 and
      Reported-by: Romain Francoise <romain@orebokech.com> # kernel panic
      Reported-by: Chris Holland <bandidoirlandes@gmail.com> # disk detection trouble
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      Cc: stable@vger.kernel.org
      Tested-by: Hatem Masmoudi <hatem.masmoudi@gmail.com> # Dell Latitude E5520
      Tested-by: janek <jan0x6c@gmail.com> # pata_jmicron with JMB362/JMB363
      [jn: with more symptoms in log message]
      Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Linus Torvalds's avatar
      selinux: inline avc_audit() and avc_has_perm_noaudit() into caller · cdb0f9a1
      Linus Torvalds authored
      Now that all the slow-path code is gone from these functions, we can
      inline them into the main caller - avc_has_perm_flags().
      Now the compiler can see that 'avc' is allocated on the stack for this
      case, which helps register pressure a bit.  It also actually shrinks the
      total stack frame, because the stack frame that avc_has_perm_flags()
      always needed (for that 'avc' allocation) is now sufficient for the
      inlined functions too.
      Inlining isn't bad - but mindless inlining of cold code (see the
      previous commit) is.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Linus Torvalds's avatar
      selinux: don't inline slow-path code into avc_has_perm_noaudit() · a554bea8
      Linus Torvalds authored
      The selinux AVC paths remain some of the hottest (and deepest) codepaths
      at filename lookup time, and we make it worse by having the slow path
      cases take up I$ and stack space even when they don't trigger.  Gcc
      tends to always want to inline functions that are just called once -
      never mind that this might make for slower and worse code in the caller.
      So this tries to improve on it a bit by making the slow-path cases
      explicitly separate functions that are marked noinline, causing gcc to
      at least no longer allocate stack space for them unless they are
      actually called.  It also seems to help register allocation a tiny bit,
      since gcc now doesn't take the slow case code into account.
      Uninlining the slow path may also allow us to inline the remaining hot
      path into the one caller that actually matters: avc_has_perm_flags().
      I'll have to look at that separately, but both avc_audit() and
      avc_has_perm_noaudit() are now small and lean enough that inlining them
      may make sense.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>