lkml.org 
[lkml]   [2008]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] ipvs: Cleanup sync daemon code
    On Sun, Feb 10, 2008 at 12:38:11AM +0100, Sven Wegener wrote:
    > struct ip_vs_sync_thread_data {
    > - struct completion *startup;
    > + struct completion *startup; /* set to NULL once completed */

    This is not needed anmore. kthread_run guarantees that the newly
    creates thread is run before returning to the caller.

    > +/* wait queue for master sync daemon */
    > +static DECLARE_WAIT_QUEUE_HEAD(sync_master_wait);

    I don't think you need this one either. You can use wake_up_process
    on the task_struct pointer instead.

    > spin_lock(&ip_vs_sync_lock);
    > list_add_tail(&sb->list, &ip_vs_sync_queue);
    > + if (++ip_vs_sync_count == 10)
    > + wake_up_interruptible(&sync_master_wait);
    > spin_unlock(&ip_vs_sync_lock);
    > }

    > -static int sync_thread(void *startup)
    > +static int sync_thread(void *data)

    Btw, it might make sense to remove sync_thread and just call the
    master and backup threads directly.
    > +void __init ip_vs_sync_init(void)
    > +{
    > + /* set up multicast address */
    > + mcast_addr.sin_family = AF_INET;
    > + mcast_addr.sin_port = htons(IP_VS_SYNC_PORT);
    > + mcast_addr.sin_addr.s_addr = htonl(IP_VS_SYNC_GROUP);
    > }

    Why can't this be initialized at compile time by:

    static struct sockaddr_in mcast_addr = {
    .sin_family = AF_INET,
    .sin_port = htons(IP_VS_SYNC_PORT),
    .sin_addr.s_addr = htonl(IP_VS_SYNC_GROUP),
    }

    (the hton* might need __constant_hton* also I'm not sure without trying)



    \
     
     \ /
      Last update: 2008-02-10 06:03    [W:0.023 / U:0.692 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site