Author Topic: How should I do with __read_mostly in linux kernel?  (Read 5020 times)

zhuizhuhaomeng

  • Community Member
  • Posts: 6
  • Hero Points: 0
How should I do with __read_mostly in linux kernel?
« on: May 30, 2010, 08:11:56 am »
just like the code below,the slickedit can not parse the code correct,so the color will not show right.
And goto-definition will not work well.
Is there someone can solve the problem ?


static struct kmem_cache *skbuff_head_cache __read_mostly;
static struct kmem_cache *skbuff_fclone_cache __read_mostly;



        struct kmem_cache *cache;
        struct skb_shared_info *shinfo;
        struct sk_buff *skb;
        u8 *data;

        cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;

        /* Get the HEAD */
        skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node);
        if (!skb)
                goto out;


hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: How should I do with __read_mostly in linux kernel?
« Reply #1 on: May 30, 2010, 10:38:59 am »
Try to hide non-std. compiler extensions from tagging using the 'C/C++ preprocessing' config.
e.g. add '#define __read_mostly' and update tag DB.
HS2
PS: Use png/jpg/etc. instead of bloated bmp for images ;)

zhuizhuhaomeng

  • Community Member
  • Posts: 6
  • Hero Points: 0
Re: How should I do with __read_mostly in linux kernel?
« Reply #2 on: May 31, 2010, 02:37:29 am »
Thank you very much!