您的位置: 飞扬精品软件园 >> 文章中心 >> 系统教程 >> Linux系统 >> 僵尸进程及其避免方法

相关文章链接

最新新闻资讯

    僵尸进程及其避免方法

    僵尸进程及其避免方法


    • 阅览次数: 文章来源: 原文作者: 整理日期: 2010-07-12


    20、DMA的变化

      未变化的有:

      void *pci_alloc_consistent(struct pci_dev *dev, size_t size,

      dma_addr_t *dma_handle);

      void pci_free_consistent(struct pci_dev *dev, size_t size,

      void *cpu_addr, dma_addr_t dma_handle);

      变化的有:

      1、void *dma_alloc_coherent(struct device *dev, size_t size,

      dma_addr_t *dma_handle, int flag);

      void dma_free_coherent(struct device *dev, size_t size,

      void *cpu_addr, dma_addr_t dma_handle);

      2、列举了映射方向:

      enum dma_data_direction {

      DMA_BIDIRECTIONAL = 0,

      DMA_TO_DEVICE = 1,

      DMA_FROM_DEVICE = 2,

      DMA_NONE = 3,

      };

      3、单映射

      dma_addr_t dma_map_single(struct device *dev, void *addr,

      size_t size,

      enum dma_data_direction direction);

      void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,

      size_t size,

      enum dma_data_direction direction);

      4、页面映射

      dma_addr_t dma_map_page(struct device *dev, struct page *page,

      unsigned long offset, size_t size,

      enum dma_data_direction direction);

      void dma_unmap_page(struct device *dev, dma_addr_t dma_addr,

      size_t size,

      enum dma_data_direction direction);

      5、有关scatter/gather的函数:

      int dma_map_sg(struct device *dev, struct scatterlist *sg,

      int nents, enum dma_data_direction direction);

      void dma_unmap_sg(struct device *dev, struct scatterlist *sg,

      int nhwentries, enum dma_data_direction direction);

      6、非一致性映射(Noncoherent DMA mappings)

      void *dma_alloc_noncoherent(struct device *dev, size_t size,

      dma_addr_t *dma_handle, int flag);

      void dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,

      unsigned long offset, size_t size,

      enum dma_data_direction direction);

      void dma_free_noncoherent(struct device *dev, size_t size,

      void *cpu_addr, dma_addr_t dma_handle);

      7、DAC (double address cycle)

      int pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask);

      void pci_dac_dma_sync_single(struct pci_dev *dev,

      dma64_addr_t dma_addr,

      size_t len, int direction);

      21、互斥

      新增seqlock主要用于:

      1、少量的数据保护

      2、数据比较简单(没有指针),并且使用频率很高

      3、对不产生任何副作用的数据的访问

      4、访问时写者不被饿死

      初始化

      seqlock_t lock1 = SEQLOCK_UNLOCKED;

      或seqlock_t lock2; seqlock_init(&lock2);

      void write_seqlock(seqlock_t *sl);

      void write_sequnlock(seqlock_t *sl);

      int write_tryseqlock(seqlock_t *sl);

      void write_seqlock_irqsave(seqlock_t *sl, long flags);

      void write_sequnlock_irqrestore(seqlock_t *sl, long flags);

      void write_seqlock_irq(seqlock_t *sl);

      void write_sequnlock_irq(seqlock_t *sl);

      void write_seqlock_bh(seqlock_t *sl);

      void write_sequnlock_bh(seqlock_t *sl);

      unsigned int read_seqbegin(seqlock_t *sl);

      int read_seqretry(seqlock_t *sl, unsigned int iv);

      unsigned int read_seqbegin_irqsave(seqlock_t *sl, long flags);

      int read_seqretry_irqrestore(seqlock_t *sl, unsigned int iv, long flags);

      22、内核可剥夺

      preempt_disable();

      preempt_enable_no_resched();

      preempt_enable_noresched();

      preempt_check_resched();

      23、眠和唤醒

      1、原来的函数可用,新增下列函数:

      prepare_to_wait_exclusive();

      prepare_to_wait();

      2、等待队列的变化

      typedef int (*wait_queue_func_t)(wait_queue_t *wait,

      unsigned mode, int sync);

      void init_waitqueue_func_entry(wait_queue_t *queue,

      wait_queue_func_t func);

    [1] [2] [3] [4]


查看所有评论

网友对僵尸进程及其避免方法 的评论

网名:
主题:
内容:
验证码: