1. 25 2月, 2014 3 次提交
    • T
      ALSA: Use priority list for managing device list · 289ca025
      Takashi Iwai 提交于
      Basically, the device type specifies the priority of the device to be
      registered / freed, too.  However, the priority value isn't well
      utilized but only it's checked as a group.  This results in
      inconsistent register and free order (where each of them should be in
      reversed direction).
      
      This patch simplifies the device list management code by simply
      inserting a list entry at creation time in an incremental order for
      the priority value.  Since we can just follow the link for register,
      disconnect and free calls, we don't have to specify the group; so the
      whole enum definitions are also simplified as well.
      
      The visible change to outside is that the priorities of some object
      types are revisited.  For example, now the SNDRV_DEV_LOWLEVEL object
      is registered before others (control, PCM, etc) and, in return,
      released after others.  Similarly, SNDRV_DEV_CODEC is in a lower
      priority than SNDRV_DEV_BUS for ensuring the dependency.
      
      Also, the unused SNDRV_DEV_TOPLEVEL, SNDRV_DEV_LOWLEVEL_PRE and
      SNDRV_DEV_LOWLEVEL_NORMAL are removed as a cleanup.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      289ca025
    • T
      ALSA: hwdep: Allow to assign the given parent · 71e2e1c1
      Takashi Iwai 提交于
      Just like PCM, allow hwdep to be assigned to a different parent device
      than the card.  It'll be used for the HD-audio codec device in the
      later patches.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      71e2e1c1
    • T
      ALSA: Create sysfs attribute files via groups · caa751ba
      Takashi Iwai 提交于
      Instead of calling each time device_create_file(), create the groups
      of sysfs attribute files at once in a normal way.  Add a new helper
      function, snd_get_device(), to return the associated device object,
      so that we can handle the sysfs addition locally.
      
      Since the sysfs file addition is done differently now,
      snd_add_device_sysfs_file() helper function is removed.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      caa751ba
  2. 21 2月, 2014 1 次提交
  3. 15 2月, 2014 1 次提交
  4. 14 2月, 2014 6 次提交
  5. 13 2月, 2014 3 次提交
  6. 12 2月, 2014 2 次提交
    • T
      ALSA: Mandate to pass a device pointer at card creation time · 393aa9c1
      Takashi Iwai 提交于
      This is a part of preliminary works for modernizing the ALSA device
      structure.  So far, we set card->dev at later point after the object
      creation.  Because of this, the core layer doesn't always know which
      device is being handled before it's actually registered, and it makes
      impossible to show the device in error messages, for example.  The
      first goal is to achieve a proper struct device initialization at the
      very beginning of probing.
      
      As a first step, this patch introduces snd_card_new() function (yes
      there was the same named function in the very past), in order to
      receive the parent device pointer from the very beginning.
      snd_card_create() is marked as deprecated.
      
      At this point, there is no functional change other than that.  The
      actual change of the device creation scheme will follow later.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      393aa9c1
    • T
      ALSA: Drop unused name argument in snd_register_oss_device() · 80d7d771
      Takashi Iwai 提交于
      The last argument, name, of snd_oss_register_device() is nowhere
      referred in the function in the current code.  Let's drop it.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      80d7d771
  7. 11 2月, 2014 6 次提交
  8. 10 2月, 2014 8 次提交
  9. 09 2月, 2014 1 次提交
  10. 08 2月, 2014 5 次提交
  11. 07 2月, 2014 3 次提交
    • E
      IB/mlx5: Fix binary compatibility with libmlx5 · 78c0f98c
      Eli Cohen 提交于
      Commit c1be5232 ("Fix micro UAR allocator") broke binary compatibility
      between libmlx5 and mlx5_ib since it defines a different value to the number
      of micro UARs per page, leading to wrong calculation in libmlx5. This patch
      defines struct mlx5_ib_alloc_ucontext_req_v2 as an extension to struct
      mlx5_ib_alloc_ucontext_req.  The extended size is determined in mlx5_ib_alloc_ucontext()
      and in case of old library we use uuarn 0 which works fine -- this is
      acheived due to create_user_qp() falling back from high to medium then to
      low class where low class will return 0.  For new libraries we use the
      more sophisticated allocation algorithm.
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NYann Droneaud <ydroneaud@opteya.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      78c0f98c
    • J
      inet: defines IPPROTO_* needed for module alias generation · ee262ad8
      Jan Moskyto Matejka 提交于
      Commit cfd280c9 ("net: sync some IP headers with glibc") changed a set of
      define's to an enum (with no explanation why) which introduced a bug
      in module mip6 where aliases are generated using the IPPROTO_* defines;
      mip6 doesn't load if require_module called with the aliases from
      xfrm_get_type().
      
      Reverting this change back to define's to fix the aliases.
      
      modinfo mip6 (before this change)
      alias:          xfrm-type-10-IPPROTO_DSTOPTS
      alias:          xfrm-type-10-IPPROTO_ROUTING
      
      modinfo mip6 (after this change)
      alias:          xfrm-type-10-43
      alias:          xfrm-type-10-60
      Signed-off-by: NJan Moskyto Matejka <mq@suse.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee262ad8
    • S
      swap: add a simple detector for inappropriate swapin readahead · 579f8290
      Shaohua Li 提交于
      This is a patch to improve swap readahead algorithm.  It's from Hugh and
      I slightly changed it.
      
      Hugh's original changelog:
      
      swapin readahead does a blind readahead, whether or not the swapin is
      sequential.  This may be ok on harddisk, because large reads have
      relatively small costs, and if the readahead pages are unneeded they can
      be reclaimed easily - though, what if their allocation forced reclaim of
      useful pages? But on SSD devices large reads are more expensive than
      small ones: if the readahead pages are unneeded, reading them in caused
      significant overhead.
      
      This patch adds very simplistic random read detection.  Stealing the
      PageReadahead technique from Konstantin Khlebnikov's patch, avoiding the
      vma/anon_vma sophistications of Shaohua Li's patch, swapin_nr_pages()
      simply looks at readahead's current success rate, and narrows or widens
      its readahead window accordingly.  There is little science to its
      heuristic: it's about as stupid as can be whilst remaining effective.
      
      The table below shows elapsed times (in centiseconds) when running a
      single repetitive swapping load across a 1000MB mapping in 900MB ram
      with 1GB swap (the harddisk tests had taken painfully too long when I
      used mem=500M, but SSD shows similar results for that).
      
      Vanilla is the 3.6-rc7 kernel on which I started; Shaohua denotes his
      Sep 3 patch in mmotm and linux-next; HughOld denotes my Oct 1 patch
      which Shaohua showed to be defective; HughNew this Nov 14 patch, with
      page_cluster as usual at default of 3 (8-page reads); HughPC4 this same
      patch with page_cluster 4 (16-page reads); HughPC0 with page_cluster 0
      (1-page reads: no readahead).
      
      HDD for swapping to harddisk, SSD for swapping to VertexII SSD.  Seq for
      sequential access to the mapping, cycling five times around; Rand for
      the same number of random touches.  Anon for a MAP_PRIVATE anon mapping;
      Shmem for a MAP_SHARED anon mapping, equivalent to tmpfs.
      
      One weakness of Shaohua's vma/anon_vma approach was that it did not
      optimize Shmem: seen below.  Konstantin's approach was perhaps mistuned,
      50% slower on Seq: did not compete and is not shown below.
      
      HDD        Vanilla Shaohua HughOld HughNew HughPC4 HughPC0
      Seq Anon     73921   76210   75611   76904   78191  121542
      Seq Shmem    73601   73176   73855   72947   74543  118322
      Rand Anon   895392  831243  871569  845197  846496  841680
      Rand Shmem 1058375 1053486  827935  764955  764376  756489
      
      SSD        Vanilla Shaohua HughOld HughNew HughPC4 HughPC0
      Seq Anon     24634   24198   24673   25107   21614   70018
      Seq Shmem    24959   24932   25052   25703   22030   69678
      Rand Anon    43014   26146   28075   25989   26935   25901
      Rand Shmem   45349   45215   28249   24268   24138   24332
      
      These tests are, of course, two extremes of a very simple case: under
      heavier mixed loads I've not yet observed any consistent improvement or
      degradation, and wider testing would be welcome.
      
      Shaohua Li:
      
      Test shows Vanilla is slightly better in sequential workload than Hugh's
      patch.  I observed with Hugh's patch sometimes the readahead size is
      shrinked too fast (from 8 to 1 immediately) in sequential workload if
      there is no hit.  And in such case, continuing doing readahead is good
      actually.
      
      I don't prepare a sophisticated algorithm for the sequential workload
      because so far we can't guarantee sequential accessed pages are swap out
      sequentially.  So I slightly change Hugh's heuristic - don't shrink
      readahead size too fast.
      
      Here is my test result (unit second, 3 runs average):
      	Vanilla		Hugh		New
      Seq	356		370		360
      Random	4525		2447		2444
      
      Attached graph is the swapin/swapout throughput I collected with 'vmstat
      2'.  The first part is running a random workload (till around 1200 of
      the x-axis) and the second part is running a sequential workload.
      swapin and swapout throughput are almost identical in steady state in
      both workloads.  These are expected behavior.  while in Vanilla, swapin
      is much bigger than swapout especially in random workload (because wrong
      readahead).
      
      Original patches by: Shaohua Li and Konstantin Khlebnikov.
      
      [fengguang.wu@intel.com: swapin_nr_pages() can be static]
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      579f8290
  12. 06 2月, 2014 1 次提交
    • P
      netfilter: nf_tables: fix racy rule deletion · 0165d932
      Pablo Neira Ayuso 提交于
      We may lost race if we flush the rule-set (which happens asynchronously
      via call_rcu) and we try to remove the table (that userspace assumes
      to be empty).
      
      Fix this by recovering synchronous rule and chain deletion. This was
      introduced time ago before we had no batch support, and synchronous
      rule deletion performance was not good. Now that we have the batch
      support, we can just postpone the purge of old rule in a second step
      in the commit phase. All object deletions are synchronous after this
      patch.
      
      As a side effect, we save memory as we don't need rcu_head per rule
      anymore.
      
      Cc: Patrick McHardy <kaber@trash.net>
      Reported-by: NArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      0165d932