On 4/25/2017 9:49 PM, Johannes Berg wrote:

                if (schedule_destroy_work) {
-                       struct cfg80211_iface_destroy *destroy;
+                       struct cfg80211_nlport_release *destroy;
destroy = kzalloc(sizeof(*destroy),
GFP_ATOMIC);

I was never really happy with this allocation and really want to get
rid of it ...

Agree. I don't like the allocation overhead either for deferred processing in another context.

+               if (schedule_sched_stop_work) {
+                       struct cfg80211_nlport_release *destroy;
+
+                       destroy = kzalloc(sizeof(*destroy),
GFP_ATOMIC);
+                       if (destroy) {
+                               destroy->nlportid = notify->portid;
+                               spin_lock(&rdev-
sched_stop_list_lock);
+                               list_add(&destroy->list, &rdev-
sched_stop_list);
+                               spin_unlock(&rdev-
sched_stop_list_lock);
+                               schedule_work(&rdev-
sched_scan_stop_wk);
+                       }
+               }

Can't we set some kind of flag in the struct
cfg80211_sched_scan_request and iterate through them later again,
checking which need to be destroyed?

Sure. In the worker we are already iterating so I guess we could. The number of internal fields in struct cfg80211_sched_scan_request with one of them being the list_head. Thinking about hiding those from the drivers. Is it worth it?

Regards,
Arend

Reply via email to