)]}'
{
  "commit": "5d6e49101e407aa7e963d3c64d22837fdfd81000",
  "tree": "6f2fb08c61976cc820269fb10baa46ac8577d4ce",
  "parents": [
    "b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3"
  ],
  "author": {
    "name": "Takashi Iwai",
    "email": "tiwai@suse.de",
    "time": "Thu Oct 28 15:00:27 2021 +0200"
  },
  "committer": {
    "name": "Takashi Iwai",
    "email": "tiwai@suse.de",
    "time": "Mon Jun 13 07:43:47 2022 +0200"
  },
  "message": "ALSA: control: Use xarray for faster lookups\n\nThe control elements are managed in a single linked list and we\ntraverse the whole list for matching each numid or ctl id per every\ninquiry of a control element.  This is OK-ish for a small number of\nelements but obviously it doesn\u0027t scale.  Especially the matching with\nthe ctl id takes time because it checks each field of the snd_ctl_id\nelement, e.g. the name string is matched with strcmp().\n\nThis patch adds the hash tables with Xarray for improving the lookup\nspeed of a control element.  There are two xarray tables added to the\ncard; one for numid and another for ctl id.  For the numid, we use the\nnumid as the index, while for the ctl id, we calculate a hash key.\n\nThe lookup is done via a single xa_load() execution.  As long as the\ngiven control element is found on the Xarray table, that\u0027s fine, we\ncan give back a quick lookup result.  The problem is when no entry\nhits on the table, and for this case, we have a slight optimization.\nNamely, the driver checks whether we had a collision on Xarray table,\nand do a fallback search (linear lookup of the full entries) only if a\nhash key collision happened beforehand.\nSo, in theory, the inquiry for a non-existing element might take still\ntime even with this patch in a worst case, but this must be pretty\nrare.\n\nThe feature is enabled via CONFIG_SND_CTL_FAST_LOOKUP, which is turned\non as default.  For simplicity, the option can be turned off only when\nCONFIG_EXPERT is set (\"You are expert? Then you manage 1000 knobs\").\n\nLink: https://lore.kernel.org/r/20211028130027.18764-1-tiwai@suse.de\nLink: https://lore.kernel.org/r/20220609180504.775-1-tiwai@suse.de\nLink: https://lore.kernel.org/all/cover.1653813866.git.quic_rbankapu@quicinc.com/\nSigned-off-by: Takashi Iwai \u003ctiwai@suse.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6d4cc49584c6372a127525a9b47710d4bcd64d8b",
      "old_mode": 33188,
      "old_path": "include/sound/core.h",
      "new_id": "dd28de2343b80657478d2fc0d1ca874f44bd26ad",
      "new_mode": 33188,
      "new_path": "include/sound/core.h"
    },
    {
      "type": "modify",
      "old_id": "dd7b40734723066c7d5deb892cd2941011995ae8",
      "old_mode": 33188,
      "old_path": "sound/core/Kconfig",
      "new_id": "25b2434e455679a03179dc12f77b3a393d95cbb2",
      "new_mode": 33188,
      "new_path": "sound/core/Kconfig"
    },
    {
      "type": "modify",
      "old_id": "a25c0d64d104f171ec8fe5eb1320919a406c9081",
      "old_mode": 33188,
      "old_path": "sound/core/control.c",
      "new_id": "6a8fd9933f062ae96af0f278e9ff27b7ad916c3e",
      "new_mode": 33188,
      "new_path": "sound/core/control.c"
    },
    {
      "type": "modify",
      "old_id": "726a8353201f834048f5a847c03fe95806441459",
      "old_mode": 33188,
      "old_path": "sound/core/init.c",
      "new_id": "1870aee7b64f68d0bb4dc8ca8104595d7415c370",
      "new_mode": 33188,
      "new_path": "sound/core/init.c"
    }
  ]
}
