- 博客(38)
- 资源 (18)
- 收藏
- 关注
原创 ext4 文件系统
static struct file_system_type ext4_fs_type = {.owner = THIS_MODULE,.name = "ext4",.mount = ext4_mount,.kill_sb = kill_block_super,.fs_flags = FS_REQUIRES_DEV,};MODULE_ALIAS_FS("
2017-02-25 22:58:43 406
原创 KVM 设备虚拟文件接口
static long kvm_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg){struct kvm *kvm = filp->private_data;void __user *argp = (void __user *)arg;int r;if (kvm->mm != curr
2017-02-25 22:54:23 563
原创 kvm-vcpu 文件接口
kvm_vm_ioctl_create_vcpuvcpu = kvm_arch_vcpu_create(kvm, id);r = kvm_arch_vcpu_setup(vcpu);r = kvm_create_vcpu_debugfs(vcpu);r = create_vcpu_fd(vcpu);kvm->vcpus[atomic_read(&kvm->onlin
2017-02-25 22:48:49 511
原创 kvm SR支持
static int kvm_suspend(void) { if (kvm_usage_count) hardware_disable_nolock(NULL); return 0; }static void kvm_resume(void) { if (kvm_usage_count) { WARN_ON(raw_spin_
2017-02-25 22:34:43 216
原创 kvm debugfs 接口
static int kvm_init_debug(void) { int r = -EEXIST; struct kvm_stats_debugfs_item *p;kvm_debugfs_dir = debugfs_create_dir("kvm", NULL);if (kvm_debugfs_dir == NULL) goto out;kvm_debugfs_n
2017-02-25 22:28:28 570
原创 kvm vm运行
用户空间发送KVM_RUN指令,通过vm的fd描述符进行。static long kvm_vcpu_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg){struct kvm_vcpu *vcpu = filp->private_data;void __user *argp = (void __user
2017-02-25 22:22:12 929
原创 kvm VM ioctl操作
VM虚拟机提供的文件操作,主要以ioctl方式提供:static struct file_operations kvm_vm_fops = {.release = kvm_vm_release,.unlocked_ioctl = kvm_vm_ioctl,#ifdef CONFIG_KVM_COMPAT.compat_ioctl = kvm_vm_compat
2017-02-25 22:06:19 1069
原创 kvm vm操作
static struct file_operations kvm_vm_fops = {.release = kvm_vm_release,.unlocked_ioctl = kvm_vm_ioctl,#ifdef CONFIG_KVM_COMPAT.compat_ioctl = kvm_vm_compat_ioctl,#endif.llseek =
2017-02-25 22:01:54 488
原创 kvm设备节点操作
KVM设备节点文件操作:static struct file_operations kvm_chardev_ops = {.unlocked_ioctl = kvm_dev_ioctl,.compat_ioctl = kvm_dev_ioctl,.llseek = noop_llseek,};static struct miscdevice kvm_dev
2017-02-25 21:57:49 754
原创 linux kernel KVM
kvm 的linux内核描述:struct kvm {spinlock_t mmu_lock;struct mutex slots_lock;struct mm_struct *mm; /* userspace tied to this vm */struct kvm_memslots *memslots[KVM_ADDRESS_SPACE_NUM];struct sr
2017-02-25 21:46:53 759
原创 struct wb_domain
/* * A wb_domain represents a domain that wb's (bdi_writeback's) belong to * and are measured against each other in. There always is one global * domain, global_wb_domain, that every wb in the
2017-02-12 21:28:38 421
原创 __alloc_pages_nodemask
/* * This is the'heart' of the zoned buddy allocator. */struct page *__alloc_pages_nodemask(gfp_t gfp_mask, unsigned intorder, structzonelist *zonelist, nodemask_t *nodem
2017-02-12 21:23:29 2220 1
原创 __alloc_pages_slowpath
static inline struct page *__alloc_pages_slowpath(gfp_t gfp_mask, unsigned intorder, structalloc_context *ac){ boolcan_direct_reclaim = gfp_mask
2017-02-12 21:22:35 1301
原创 get_page_from_freelist
/* *get_page_from_freelist goes through the zonelist trying to allocate * a page. */static struct page *get_page_from_freelist(gfp_t gfp_mask, unsigned intorder, int alloc_flags,
2017-02-12 21:22:06 1165
原创 zone_watermark_ok
boolzone_watermark_ok_safe(struct zone *z, unsigned int order, unsigned long mark, intclasszone_idx){ long free_pages = zone_page_state(z,NR_FREE_PAGES); if
2017-02-11 23:50:10 763
原创 zone_reclaim
int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned intorder){ int node_id; int ret; if (zone_pagecache_reclaimable(zone)min_unmapped_pages && zone_pag
2017-02-11 23:43:53 781
原创 age_active_anon
static void age_active_anon(struct zone *zone, struct scan_control *sc){ struct mem_cgroup *memcg; if(!total_swap_pages) return; memcg = mem_cgroup_iter(
2017-02-11 23:38:08 510
原创 shrink_zone_memcg
/* * This is a basic per-zone page freer. Used by both kswapd and direct reclaim. */static voidshrink_zone_memcg(struct zone *zone, struct mem_cgroup *memcg, struct
2017-02-11 23:34:39 523
原创 inactive_list_is_low
/* * The inactive anon list should be smallenough that the VM never has * to do too much work. * * The inactive file list should be smallenough to leave most memory * to the established work
2017-02-11 23:33:38 375
原创 pageout
/* * pageout is called by shrink_page_list() foreach dirty page. * Calls ->writepage(). */staticpageout_t pageout(struct page *page, struct address_space *mapping, struc
2017-02-11 23:32:09 543
原创 zone_reclaimable
boolzone_reclaimable(struct zone *zone){ return zone_page_state_snapshot(zone, NR_PAGES_SCANNED) zone_reclaimable_pages(zone)* 6;} static inlineunsigned long zone_page_
2017-02-11 23:29:24 314
原创 balance_pgdat
/* * For kswapd, balance_pgdat() will work across all this node's zones until * they are all at high_wmark_pages(zone). * * Returns the highest zone idx kswapd was reclaiming at * * There
2017-02-11 23:25:26 532
原创 kswapd_shrink_zone
/* * kswapd shrinks the zone by the number ofpages required to reach * the high watermark. * * Returns true if kswapd scanned at least therequested number of pages to * reclaim or if the lac
2017-02-11 23:23:42 356
原创 pgdat_balanced
/* * pgdat_balanced() is used when checking if anode is balanced. * * For order-0, all zones must be balanced! * * For high-order allocations only zones thatmeet watermarks and are in a *
2017-02-11 23:21:10 340
原创 zone_balanced
static bool zone_balanced(struct zone *zone, int order, bool highorder, unsigned long balance_gap,int classzone_idx){ unsignedlong mark = high_wmark_pages(zone) + balan
2017-02-11 23:18:58 295
原创 do_try_to_free_pages
/* * This is the main entry point to direct pagereclaim. * * If a full scan of the inactive list fails tofree enough memory then we * are "out of memory" and somethingneeds to be killed. *
2017-02-11 23:13:37 598
原创 shrink_zones
static void shrink_zones(struct zonelist *zonelist,struct scan_control *sc){ struct zoneref *z; struct zone *zone; unsigned long nr_soft_reclaimed; unsigned long nr_s
2017-02-11 23:10:33 417
原创 get_scan_count
/* * Determine how aggressively the anon and file LRU lists should be * scanned. The relative value of each set of LRU lists is determined * by looking at the fraction of the pages scanned we d
2017-02-11 23:04:06 987
原创 shrink_list
static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,struct lruvec *lruvec, struct scan_control *sc){if (is_active_lru(lru)) {if (inactive_list_is_low(lruvec, is_file_l
2017-02-11 22:55:03 292
原创 shrink_inactive_list
static noinline_for_stack unsigned long shrink_inactive_list(unsigned long nr_to_scan,struct lruvec *lruvec, struct scan_control *sc, enum lru_list lru){ LIST_HEAD(page_list); un
2017-02-11 22:50:48 428
原创 shrink_active_list
static void shrink_active_list(unsignedlong nr_to_scan, struct lruvec *lruvec, struct scan_control *sc, enum lru_list lru){ unsignedlong nr_taken; unsignedlong nr_scanned;
2017-02-11 22:45:43 560
原创 shrink_page_list(
static unsigned longshrink_page_list(struct list_head *page_list, struct zone *zone, struct scan_control *sc,enum ttu_flagsttu_flags,
2017-02-11 22:37:47 1080
原创 isolate_lru_pages
static unsigned long isolate_lru_pages(unsigned longnr_to_scan, struct lruvec *lruvec, struct list_head*dst, unsignedlong *nr_scanned, struct scan_control *sc,
2017-02-11 22:28:35 883
原创 isolate_lru_page
isolate_lru_pageint isolate_lru_page(struct page *page){int ret = -EBUSY;VM_BUG_ON_PAGE(!page_count(page), page);WARN_RATELIMIT(PageTail(page), "trying to isolate tail page");i
2017-02-11 22:10:40 1191
没有程序语言是完美的.甚至没有一个唯一最好的语言,只有对于特定目的,比较适合和不适合
2010-06-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人