asoc: msm: use hashtable to check kcontrol
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 asoc: msm: use hashtable to check kcontrol
use hashtabe instead of linear list to check kcontrol before adding them for improving early audio KPI.
Change-Id I7134816736e08e338c0f22a8ae283a0520aa847a
Signed-off-by Raghu Bankapur <[email protected]>
--- include/sound/control.h | 2 + include/sound/core.h | 5 +- sound/core/control.c | 106 +++++++++++++++++++++++----------------- sound/core/init.c | 1 + 4 files changed, 68 insertions(+), 46 deletions(-)
include/sound/control.h +2 -0
@@ -70,6 +70,8 @@ struct snd_kcontrol_volatile {struct snd_kcontrol {struct list_head list;/* list of controls */ struct snd_ctl_elem_id id; +struct hlist_node hnode; +unsigned int knametoint;/* kctl name to uint, hash key value */ unsigned int count;/* count of same elements */ snd_kcontrol_info_t *info;snd_kcontrol_get_t *get;
include/sound/core.h +4 -1
@@ -14,6 +14,7 @@#include <linux/pm.h> /* pm_message_t */ #include <linux/stringify.h> #include <linux/printk.h> +#include <linux/hashtable.h> /* number of supported soundcards */ #ifdef CONFIG_SND_DYNAMIC_MINORS
@@ -24,6 +25,8 @@#define CONFIG_SND_MAJOR 116/* standard configuration */ +#define SND_CTL_HASH_TABLE_BITS 14/* buckets numbers: 1 << 14 */ +/* forward declarations */ struct pci_dev ;struct module ;
@@ -103,7 +106,7 @@ struct snd_card {size_t user_ctl_alloc_size;// current memory allocation by user controls. struct list_head controls;/* all controls for this card */ struct list_head ctl_files;/* active control files */ - +DECLARE_HASHTABLE (ctl_htable,SND_CTL_HASH_TABLE_BITS );struct snd_info_entry *proc_root;/* root for soundcard specific files */ struct proc_dir_entry *proc_root_link;/* number link to real id */
sound/core/control.c +61 -45
136 lines not on this page · raw message
sound/core/init.c +1 -0
@@ -284,6 +284,7 @@ static int snd_card_init(struct snd_card *card, struct device *parent,INIT_LIST_HEAD (&card->ctl_files);spin_lock_init (&card->files_lock);INIT_LIST_HEAD (&card->files_list); +hash_init (card->ctl_htable);mutex_init (&card->memory_mutex);#ifdef CONFIG_PM init_waitqueue_head (&card->power_sleep);
Signature · 1 line
2.17.1
Quoted 6 lines · Raghu Bankapur
use hashtabe instead of linear list to check kcontrol before adding them for improving early audio KPI.
Change-Id I7134816736e08e338c0f22a8ae283a0520aa847aSigned-off-by Raghu Bankapur <[email protected]>
Any follow up for my previous concerns?
https://lore.kernel.org/[email protected]/
And, no need for resending the very same patch just to drop the cover letter.
thanks,
Takashi