Changeset 270


Ignore:
Timestamp:
05/08/14 01:24:05 (10 years ago)
Author:
atzm
Message:

revert r269, this causes cpu soft lockup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ksyslog/trunk/ksyslog.c

    r269 r270  
    2222static struct socket *ksyslog_rcv_sk = NULL; 
    2323 
    24 static struct delayed_work __percpu *ksyslog_work = NULL; 
     24static struct delayed_work ksyslog_work; 
    2525static struct workqueue_struct *ksyslog_wq = NULL; 
    2626 
     
    297297 
    298298static void 
    299 ksyslog_work_register_cpu(int cpu, struct delayed_work *work, unsigned long timer) 
    300 { 
    301         queue_delayed_work_on(cpu, ksyslog_wq, work, timer * HZ / 1000); 
    302 } 
    303  
    304 static void 
    305299ksyslog_work_register(unsigned long timer) 
    306300{ 
    307         int cpu; 
    308  
    309         for_each_possible_cpu(cpu) 
    310                 ksyslog_work_register_cpu(cpu, per_cpu_ptr(ksyslog_work, cpu), timer); 
     301        queue_delayed_work(ksyslog_wq, &ksyslog_work, timer * HZ / 1000); 
    311302} 
    312303 
     
    314305ksyslog_work_unregister(void) 
    315306{ 
    316         int cpu; 
    317  
    318         for_each_possible_cpu(cpu) 
    319                 cancel_delayed_work_sync(per_cpu_ptr(ksyslog_work, cpu)); 
     307        cancel_delayed_work_sync(&ksyslog_work); 
    320308} 
    321309 
     
    360348 
    361349out: 
    362         ksyslog_work_register_cpu(smp_processor_id(), 
    363                                   per_cpu_ptr(ksyslog_work, smp_processor_id()), 
    364                                   ksyslog_flush_interval); 
     350        ksyslog_work_register(ksyslog_flush_interval); 
    365351} 
    366352 
     
    631617        ksyslog_rcv_sk = NULL; 
    632618 
    633         if (ksyslog_work) { 
     619        if (ksyslog_wq) { 
    634620                ksyslog_work_unregister(); 
    635                 free_percpu(ksyslog_work); 
    636         } 
    637         ksyslog_work = NULL; 
    638  
    639         if (ksyslog_wq) 
    640621                destroy_workqueue(ksyslog_wq); 
     622        } 
    641623        ksyslog_wq = NULL; 
    642624 
     
    654636ksyslog_init(void) 
    655637{ 
    656         int cpu, err; 
     638        int err; 
    657639        struct sockaddr_in sin; 
    658640 
     
    674656        } 
    675657 
    676         ksyslog_work = alloc_percpu(struct delayed_work); 
    677         if (!ksyslog_work) { 
    678                 pr_err("ksyslog: alloc_percpu(ksyslog_work) failed\n"); 
    679                 err = -ENOMEM; 
    680                 goto err; 
    681         } 
    682         for_each_possible_cpu(cpu) 
    683                 INIT_DELAYED_WORK(per_cpu_ptr(ksyslog_work, cpu), ksyslog_work_handler); 
     658        INIT_DELAYED_WORK(&ksyslog_work, ksyslog_work_handler); 
    684659 
    685660        err = sock_create(AF_INET, SOCK_DGRAM, 0, &ksyslog_rcv_sk); 
Note: See TracChangeset for help on using the changeset viewer.