您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ update_page_reclaim_stat函数代码示例

51自学网 2021-06-03 09:15:40
  C++
这篇教程C++ update_page_reclaim_stat函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中update_page_reclaim_stat函数的典型用法代码示例。如果您正苦于以下问题:C++ update_page_reclaim_stat函数的具体用法?C++ update_page_reclaim_stat怎么用?C++ update_page_reclaim_stat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了update_page_reclaim_stat函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: lru_add_page_tail

/* used by __split_huge_page_refcount() */void lru_add_page_tail(struct zone* zone,		       struct page *page, struct page *page_tail){	int active;	enum lru_list lru;	const int file = 0;	struct list_head *head;	VM_BUG_ON(!PageHead(page));	VM_BUG_ON(PageCompound(page_tail));	VM_BUG_ON(PageLRU(page_tail));	VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&zone->lru_lock));	SetPageLRU(page_tail);	if (page_evictable(page_tail, NULL)) {		if (PageActive(page)) {			SetPageActive(page_tail);			active = 1;			lru = LRU_ACTIVE_ANON;		} else {			active = 0;			lru = LRU_INACTIVE_ANON;		}		update_page_reclaim_stat(zone, page_tail, file, active);		if (likely(PageLRU(page)))			head = page->lru.prev;		else			head = &zone->lru[lru].list;		__add_page_to_lru_list(zone, page_tail, lru, head);	} else {		SetPageUnevictable(page_tail);		add_page_to_lru_list(zone, page_tail, LRU_UNEVICTABLE);	}}
开发者ID:novic,项目名称:AniDroid-Hardened-Kernel,代码行数:36,


示例2: __pagevec_lru_add_fn

static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec,				 void *arg){	enum lru_list lru;	int was_unevictable = TestClearPageUnevictable(page);	VM_BUG_ON_PAGE(PageLRU(page), page);	SetPageLRU(page);	/*	 * Page becomes evictable in two ways:	 * 1) Within LRU lock [munlock_vma_pages() and __munlock_pagevec()].	 * 2) Before acquiring LRU lock to put the page to correct LRU and then	 *   a) do PageLRU check with lock [check_move_unevictable_pages]	 *   b) do PageLRU check before lock [clear_page_mlock]	 *	 * (1) & (2a) are ok as LRU lock will serialize them. For (2b), we need	 * following strict ordering:	 *	 * #0: __pagevec_lru_add_fn		#1: clear_page_mlock	 *	 * SetPageLRU()				TestClearPageMlocked()	 * smp_mb() // explicit ordering	// above provides strict	 *					// ordering	 * PageMlocked()			PageLRU()	 *	 *	 * if '#1' does not observe setting of PG_lru by '#0' and fails	 * isolation, the explicit barrier will make sure that page_evictable	 * check will put the page in correct LRU. Without smp_mb(), SetPageLRU	 * can be reordered after PageMlocked check and can make '#1' to fail	 * the isolation of the page whose Mlocked bit is cleared (#0 is also	 * looking at the same page) and the evictable page will be stranded	 * in an unevictable LRU.	 */	smp_mb();	if (page_evictable(page)) {		lru = page_lru(page);		update_page_reclaim_stat(lruvec, page_is_file_cache(page),					 PageActive(page));		if (was_unevictable)			count_vm_event(UNEVICTABLE_PGRESCUED);	} else {		lru = LRU_UNEVICTABLE;		ClearPageActive(page);		SetPageUnevictable(page);		if (!was_unevictable)			count_vm_event(UNEVICTABLE_PGCULLED);	}	add_page_to_lru_list(page, lruvec, lru);	trace_mm_lru_insertion(page, lru);}
开发者ID:Lyude,项目名称:linux,代码行数:54,


示例3: lru_add_page_tail

/* used by __split_huge_page_refcount() */void lru_add_page_tail(struct page *page, struct page *page_tail,		       struct lruvec *lruvec, struct list_head *list){	int uninitialized_var(active);	enum lru_list lru;	const int file = 0;	VM_BUG_ON(!PageHead(page));	VM_BUG_ON(PageCompound(page_tail));	VM_BUG_ON(PageLRU(page_tail));	VM_BUG_ON(NR_CPUS != 1 &&		  !spin_is_locked(&lruvec_zone(lruvec)->lru_lock));	if (!list)		SetPageLRU(page_tail);	if (page_evictable(page_tail)) {		if (PageActive(page)) {			SetPageActive(page_tail);			active = 1;			lru = LRU_ACTIVE_ANON;		} else {			active = 0;			lru = LRU_INACTIVE_ANON;		}	} else {		SetPageUnevictable(page_tail);		lru = LRU_UNEVICTABLE;	}	if (likely(PageLRU(page)))		list_add_tail(&page_tail->lru, &page->lru);	else if (list) {		/* page reclaim is reclaiming a huge page */		get_page(page_tail);		list_add_tail(&page_tail->lru, list);	} else {		struct list_head *list_head;		/*		 * Head page has not yet been counted, as an hpage,		 * so we must account for each subpage individually.		 *		 * Use the standard add function to put page_tail on the list,		 * but then correct its position so they all end up in order.		 */		add_page_to_lru_list(page_tail, lruvec, lru);		list_head = page_tail->lru.prev;		list_move_tail(&page_tail->lru, list_head);	}	if (!PageUnevictable(page))		update_page_reclaim_stat(lruvec, file, active);}
开发者ID:duki994,项目名称:SM-G850_Kernel_LP,代码行数:54,


示例4: __pagevec_lru_add_fn

static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec,				 void *arg){	int file = page_is_file_cache(page);	int active = PageActive(page);	enum lru_list lru = page_lru(page);	VM_BUG_ON(PageLRU(page));	SetPageLRU(page);	add_page_to_lru_list(page, lruvec, lru);	update_page_reclaim_stat(lruvec, file, active);}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:13,


示例5: __pagevec_lru_add_fn

static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec,				 void *arg){	int file = page_is_file_cache(page);	int active = PageActive(page);	enum lru_list lru = page_lru(page);	VM_BUG_ON_PAGE(PageLRU(page), page);	SetPageLRU(page);	add_page_to_lru_list(page, lruvec, lru);	update_page_reclaim_stat(lruvec, file, active);	trace_mm_lru_insertion(page, page_to_pfn(page), lru, trace_pagemap_flags(page));}
开发者ID:7799,项目名称:linux,代码行数:14,


示例6: __activate_page

static void __activate_page(struct page *page, struct lruvec *lruvec,			    void *arg){	if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) {		int file = page_is_file_cache(page);		int lru = page_lru_base_type(page);		del_page_from_lru_list(page, lruvec, lru);		SetPageActive(page);		lru += LRU_ACTIVE;		add_page_to_lru_list(page, lruvec, lru);		__count_vm_event(PGACTIVATE);		update_page_reclaim_stat(lruvec, file, 1);	}}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:16,


示例7: lru_deactivate_fn

static void lru_deactivate_fn(struct page *page, struct lruvec *lruvec,			    void *arg){	if (PageLRU(page) && PageActive(page) && !PageUnevictable(page)) {		int file = page_is_file_cache(page);		int lru = page_lru_base_type(page);		del_page_from_lru_list(page, lruvec, lru + LRU_ACTIVE);		ClearPageActive(page);		ClearPageReferenced(page);		add_page_to_lru_list(page, lruvec, lru);		__count_vm_event(PGDEACTIVATE);		update_page_reclaim_stat(lruvec, file, 0);	}}
开发者ID:forgivemyheart,项目名称:linux,代码行数:16,


示例8: lru_deactivate_fn

/* * If the page can not be invalidated, it is moved to the * inactive list to speed up its reclaim.  It is moved to the * head of the list, rather than the tail, to give the flusher * threads some time to write it out, as this is much more * effective than the single-page writeout from reclaim. * * If the page isn't page_mapped and dirty/writeback, the page * could reclaim asap using PG_reclaim. * * 1. active, mapped page -> none * 2. active, dirty/writeback page -> inactive, head, PG_reclaim * 3. inactive, mapped page -> none * 4. inactive, dirty/writeback page -> inactive, head, PG_reclaim * 5. inactive, clean -> inactive, tail * 6. Others -> none * * In 4, why it moves inactive's head, the VM expects the page would * be write it out by flusher threads as this is much more effective * than the single-page writeout from reclaim. */static void lru_deactivate_fn(struct page *page, void *arg){	int lru, file;	bool active;	struct zone *zone = page_zone(page);	if (!PageLRU(page))		return;	if (PageUnevictable(page))		return;	/* Some processes are using the page */	if (page_mapped(page))		return;	active = PageActive(page);	file = page_is_file_cache(page);	lru = page_lru_base_type(page);	del_page_from_lru_list(zone, page, lru + active);	ClearPageActive(page);	ClearPageReferenced(page);	add_page_to_lru_list(zone, page, lru);	if (PageWriteback(page) || PageDirty(page)) {		/*		 * PG_reclaim could be raced with end_page_writeback		 * It can make readahead confusing.  But race window		 * is _really_ small and  it's non-critical problem.		 */		SetPageReclaim(page);	} else {		struct lruvec *lruvec;		/*		 * The page's writeback ends up during pagevec		 * We moves tha page into tail of inactive.		 */		lruvec = mem_cgroup_lru_move_lists(zone, page, lru, lru);		list_move_tail(&page->lru, &lruvec->lists[lru]);		__count_vm_event(PGROTATED);	}	if (active)		__count_vm_event(PGDEACTIVATE);	update_page_reclaim_stat(zone, page, file, 0);}
开发者ID:EddyKuo,项目名称:linux-sdk-kernel-source,代码行数:68,


示例9: __pagevec_lru_add_fn

static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec,				 void *arg){	enum lru_list lru = (enum lru_list)arg;	int file = is_file_lru(lru);	int active = is_active_lru(lru);	VM_BUG_ON(PageActive(page));	VM_BUG_ON(PageUnevictable(page));	VM_BUG_ON(PageLRU(page));	SetPageLRU(page);	if (active)		SetPageActive(page);	add_page_to_lru_list(page, lruvec, lru);	update_page_reclaim_stat(lruvec, file, active);}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:17,


示例10: lru_add_page_tail

/* used by __split_huge_page_refcount() */void lru_add_page_tail(struct zone* zone,		       struct page *page, struct page *page_tail){	int active;	enum lru_list lru;	const int file = 0;	VM_BUG_ON(!PageHead(page));	VM_BUG_ON(PageCompound(page_tail));	VM_BUG_ON(PageLRU(page_tail));	VM_BUG_ON(!spin_is_locked(&zone->lru_lock));	SetPageLRU(page_tail);	if (page_evictable(page_tail, NULL)) {		if (PageActive(page)) {			SetPageActive(page_tail);			active = 1;			lru = LRU_ACTIVE_ANON;		} else {			active = 0;			lru = LRU_INACTIVE_ANON;		}		update_page_reclaim_stat(zone, page_tail, file, active);	} else {		SetPageUnevictable(page_tail);		lru = LRU_UNEVICTABLE;	}	if (likely(PageLRU(page)))		list_add_tail(&page_tail->lru, &page->lru);	else {		struct list_head *list_head;		/*		 * Head page has not yet been counted, as an hpage,		 * so we must account for each subpage individually.		 *		 * Use the standard add function to put page_tail on the list,		 * but then correct its position so they all end up in order.		 */		add_page_to_lru_list(zone, page_tail, lru);		list_head = page_tail->lru.prev;		list_move_tail(&page_tail->lru, list_head);	}}
开发者ID:daveti,项目名称:prov-kernel,代码行数:46,


示例11: add_page_to_lru_list_cma

/* * added by qijiwen. * put the page on the lru directly */void add_page_to_lru_list_cma(struct page *page, enum lru_list lru){	struct zone *zone = page_zone(page);	int file = is_file_lru(lru);	int active = is_active_lru(lru);	unsigned long flags = 0;	VM_BUG_ON(PageActive(page));	VM_BUG_ON(PageUnevictable(page));	VM_BUG_ON(PageLRU(page));	spin_lock_irqsave(&zone->lru_lock, flags);	SetPageLRU(page);	if (active)		SetPageActive(page);	update_page_reclaim_stat(zone, page, file, active);	add_page_to_lru_list(zone, page, lru);	spin_unlock_irqrestore(&zone->lru_lock, flags);}
开发者ID:printusrzero,项目名称:hwp6s-kernel,代码行数:23,


示例12: lru_add_page_tail

/* used by __split_huge_page_refcount() */void lru_add_page_tail(struct page *page, struct page *page_tail,		       struct lruvec *lruvec, struct list_head *list){	const int file = 0;	VM_BUG_ON_PAGE(!PageHead(page), page);	VM_BUG_ON_PAGE(PageCompound(page_tail), page);	VM_BUG_ON_PAGE(PageLRU(page_tail), page);	VM_BUG_ON(NR_CPUS != 1 &&		  !spin_is_locked(&lruvec_pgdat(lruvec)->lru_lock));	if (!list)		SetPageLRU(page_tail);	if (likely(PageLRU(page)))		list_add_tail(&page_tail->lru, &page->lru);	else if (list) {		/* page reclaim is reclaiming a huge page */		get_page(page_tail);		list_add_tail(&page_tail->lru, list);	} else {		struct list_head *list_head;		/*		 * Head page has not yet been counted, as an hpage,		 * so we must account for each subpage individually.		 *		 * Use the standard add function to put page_tail on the list,		 * but then correct its position so they all end up in order.		 */		add_page_to_lru_list(page_tail, lruvec, page_lru(page_tail));		list_head = page_tail->lru.prev;		list_move_tail(&page_tail->lru, list_head);	}	if (!PageUnevictable(page))		update_page_reclaim_stat(lruvec, file, PageActive(page_tail));}
开发者ID:Lyude,项目名称:linux,代码行数:38,


示例13: lru_lazyfree_fn

static void lru_lazyfree_fn(struct page *page, struct lruvec *lruvec,			    void *arg){	if (PageLRU(page) && PageAnon(page) && PageSwapBacked(page) &&	    !PageSwapCache(page) && !PageUnevictable(page)) {		bool active = PageActive(page);		del_page_from_lru_list(page, lruvec,				       LRU_INACTIVE_ANON + active);		ClearPageActive(page);		ClearPageReferenced(page);		/*		 * lazyfree pages are clean anonymous pages. They have		 * SwapBacked flag cleared to distinguish normal anonymous		 * pages		 */		ClearPageSwapBacked(page);		add_page_to_lru_list(page, lruvec, LRU_INACTIVE_FILE);		__count_vm_events(PGLAZYFREE, hpage_nr_pages(page));		count_memcg_page_event(page, PGLAZYFREE);		update_page_reclaim_stat(lruvec, 1, 0);	}}
开发者ID:Lyude,项目名称:linux,代码行数:24,



注:本文中的update_page_reclaim_stat函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ update_panels函数代码示例
C++ update_names函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。