Re: [PATCH v1] virtio_pmem: populate numa information

2022-11-16 Thread Pankaj Gupta
> > > > > > > > Compute the numa information for a virtio_pmem device from the > > > > > > > > memory > > > > > > > > range of the device. Previously, the target_node was always 0 > > > > > > > > since > > > > > > > > the ndr_desc.target_node field was never explicitly set. The > > > > > > > >

Re: [PATCH v1] virtio_pmem: populate numa information

2022-11-13 Thread Pankaj Gupta
> > Pankaj Gupta wrote: > > > > > > Compute the numa information for a virtio_pmem device from the > > > > > > memory > > > > > > range of the device. Previously, the target_node was always 0 since > > > &g

Re: [PATCH v1] virtio_pmem: populate numa information

2022-10-26 Thread Pankaj Gupta
> > > Compute the numa information for a virtio_pmem device from the memory > > > range of the device. Previously, the target_node was always 0 since > > > the ndr_desc.target_node field was never explicitly set. The code for > > > computing the numa node is taken from cxl_pmem_region_probe in > >

Re: [PATCH v1] virtio_pmem: populate numa information

2022-10-21 Thread Pankaj Gupta
> Compute the numa information for a virtio_pmem device from the memory > range of the device. Previously, the target_node was always 0 since > the ndr_desc.target_node field was never explicitly set. The code for > computing the numa node is taken from cxl_pmem_region_probe in >

Re: [RFC v3 1/2] virtio-pmem: Async virtio-pmem flush

2022-02-16 Thread Pankaj Gupta
es, thus adhers to flush coalscing logic. This is > > > > > > s/adhers/adheres/ > > > > > > s/coalscing/coalescing/ > > > > > > > important for maintaining the flush request order with request > > > > coalscing. > >

Re: [RFC v3 2/2] pmem: enable pmem_submit_bio for asynchronous flush

2022-02-16 Thread Pankaj Gupta
> > > > Return from "pmem_submit_bio" when asynchronous flush is > > > > still in progress in other context. > > > > > > > > Signed-off-by: Pankaj Gupta > > > > --- > > > > drivers/nvdimm/pmem.c| 15 ++

Re: [RFC v3 1/2] virtio-pmem: Async virtio-pmem flush

2022-02-16 Thread Pankaj Gupta
oalescing/ > > > important for maintaining the flush request order with request coalscing. > > s/coalscing/coalescing/ o.k. Sorry for the spelling mistakes. > > > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/nvdimm/nd_virtio.c | 74

Re: [RFC v3 2/2] pmem: enable pmem_submit_bio for asynchronous flush

2022-02-16 Thread Pankaj Gupta
> > > > Return from "pmem_submit_bio" when asynchronous flush is > > still in progress in other context. > > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/nvdimm/pmem.c| 15 --- > > drivers/nvdimm/region_

Re: [RFC v3 0/2] virtio-pmem: Asynchronous flush

2022-01-28 Thread Pankaj Gupta
declare'INIT_WORK' only once. > - More testing and bug fix. > > [1] https://marc.info/?l=linux-kernel=157446316409937=2 > > Pankaj Gupta (2): > virtio-pmem: Async virtio-pmem flush > pmem: enable pmem_submit_bio for asynchronous flush > > drivers/nvdimm/nd_virtio.c

[RFC v3 2/2] pmem: enable pmem_submit_bio for asynchronous flush

2022-01-11 Thread Pankaj Gupta
Return from "pmem_submit_bio" when asynchronous flush is still in progress in other context. Signed-off-by: Pankaj Gupta --- drivers/nvdimm/pmem.c| 15 --- drivers/nvdimm/region_devs.c | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/driv

[RFC v3 1/2] virtio-pmem: Async virtio-pmem flush

2022-01-11 Thread Pankaj Gupta
queue). For all the requests come between ongoing flush and new flush start time, only single flush executes, thus adhers to flush coalscing logic. This is important for maintaining the flush request order with request coalscing. Signed-off-by: Pankaj Gupta --- drivers/nvdimm/nd_virtio.c | 74

[RFC v3 0/2] virtio-pmem: Asynchronous flush

2022-01-11 Thread Pankaj Gupta
tps://marc.info/?l=linux-kernel=157446316409937=2 Pankaj Gupta (2): virtio-pmem: Async virtio-pmem flush pmem: enable pmem_submit_bio for asynchronous flush drivers/nvdimm/nd_virtio.c | 74 +++- drivers/nvdimm/pmem.c| 15 ++-- drivers/nvd

[PATCH] virtio-pmem: add myself as virtio-pmem maintainer

2021-10-16 Thread Pankaj Gupta
From: Pankaj Gupta Adding myself as virtio-pmem maintainer and also adding virtualization mailing list entry for virtio specific bits. Helps to get notified for appropriate bug fixes & enhancements. Signed-off-by: Pankaj Gupta --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+)

Re: [RFC v2 0/2] virtio-pmem: Asynchronous flush

2021-10-16 Thread Pankaj Gupta
Friendly ping! Thanks, Pankaj On Thu, 19 Aug 2021 at 13:08, Pankaj Gupta wrote: > > Gentle ping. > > > > > Jeff reported preflush order issue with the existing implementation > > of virtio pmem preflush. Dan suggested[1] to implement asynchronous flush > >

Re: [RFC v2 1/2] virtio-pmem: Async virtio-pmem flush

2021-08-27 Thread Pankaj Gupta
> > > > > > Implement asynchronous flush for virtio pmem using work queue > > > > > > to solve the preflush ordering issue. Also, coalesce the flush > > > > > > requests when a flush is already in process. > > > > > > >

Re: [RFC v2 1/2] virtio-pmem: Async virtio-pmem flush

2021-08-25 Thread Pankaj Gupta
en a flush is already in process. > > > > > > > > Signed-off-by: Pankaj Gupta > > > > --- > > > > drivers/nvdimm/nd_virtio.c | 72 > > > > drivers/nvdimm/virtio_pmem.c | 10 - > > > &g

Re: [RFC v2 1/2] virtio-pmem: Async virtio-pmem flush

2021-08-25 Thread Pankaj Gupta
Hi Dan, Thank you for the review. Please see my reply inline. > > Implement asynchronous flush for virtio pmem using work queue > > to solve the preflush ordering issue. Also, coalesce the flush > > requests when a flush is already in process. > > > &g

Re: [RFC 0/2] virtio-pmem: Asynchronous flush

2021-03-11 Thread Pankaj Gupta
preflush ordering issue and also makes the flush > > asynchronous from the submitting thread POV. > > > > Submitting this patch series for feeback and is in WIP. I have > > done basic testing and currently doing more testing. > > > > Pankaj Gupta (2): > >

Re: [PATCH v1] mm/memory_hotplug: MEMHP_MERGE_RESOURCE -> MHP_MERGE_RESOURCE

2021-02-02 Thread Pankaj Gupta
1-4f7d-f944-cfd7d81c3...@redhat.com/ > > Cc: Andrew Morton > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Stephen Hemminger > Cc: Wei Liu > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Boris Ostrovsky > Cc: Juergen Gross > Cc:

Re: [PATCH v2 1/1] vhost scsi: alloc vhost_scsi with kvzalloc() to avoid delay

2021-02-02 Thread Pankaj Gupta
; __GFP_RETRY_MAYFAIL); > - if (!vs) { > - vs = vzalloc(sizeof(*vs)); > - if (!vs) > - goto err_vs; > - } > + vs = kvzalloc(sizeof(*vs), GFP_KERNEL); > + if (!vs) > + goto err_vs; > > vqs = kmalloc_array(VHOST_SCSI_MAX_VQ, sizeof(*vqs), GFP_KERNEL); > if (!vqs) Acked-by: Pankaj Gupta

Re: [PATCH v4 1/7] mm: memcontrol: fix NR_ANON_THPS accounting in charge moving

2020-12-10 Thread Pankaj Gupta
r_pages); > + __dec_lruvec_state(from_vec, NR_ANON_THPS); > + __inc_lruvec_state(to_vec, NR_ANON_THPS); > } > > } Acked-by: Pankaj Gupta

Re: [PATCH v2 1/8] mm/gup: perform check_dax_vmas only when FS_DAX is enabled

2020-12-09 Thread Pankaj Gupta
} > return false; > } > +#else > +static bool check_dax_vmas(struct vm_area_struct **vmas, long nr_pages) > +{ > + return false; > +} > +#endif > > #ifdef CONFIG_CMA > static long check_and_migrate_cma_pages(struct mm_struct *mm, Reviewed-by: Pankaj Gupta

Re: [PATCH v3 7/7] mm: memcontrol: make the slab calculation consistent

2020-12-07 Thread Pankaj Gupta
> Although the ratio of the slab is one, we also should read the ratio > from the related memory_stats instead of hard-coding. And the local > variable of size is already the value of slab_unreclaimable. So we > do not need to read again. > > We can drop the ratio in struct memory_stat. This can

Re: [PATCH] mm/shmem.c: make shmem_mapping() inline

2020-11-13 Thread Pankaj Gupta
e > return inode; > } > > -bool shmem_mapping(struct address_space *mapping) > +inline bool shmem_mapping(struct address_space *mapping) > { > return mapping->a_ops == _aops; > } Reviewed-by: Pankaj Gupta

Re: [PATCH] mm/page_counter: use page_counter_read in page_counter_set_max

2020-11-13 Thread Pankaj Gupta
(>max, nr_pages); > > - if (atomic_long_read(>usage) <= usage) > + if (page_counter_read(counter) <= usage) > return 0; > > counter->max = old; Reviewed-by: Pankaj Gupta

Re: [PATCH v3 3/7] mm, page_alloc: remove setup_pageset()

2020-11-11 Thread Pankaj Gupta
alues safe for a boot pageset. A true percpu > +* pageset's initialization will update them subsequently. Here we > don't > +* need to be as careful as pageset_update() as nobody can access the > +* pageset yet. > +*/ > + pcp->high = 0; > + pcp->batch = 1; > } Acked-by: Pankaj Gupta

Re: [PATCH v3 2/7] mm, page_alloc: calculate pageset high and batch once per zone

2020-11-11 Thread Pankaj Gupta
ysctl_handler(struct > ctl_table *table, int write, > goto out; > > for_each_populated_zone(zone) > - __zone_pcp_update(zone); > + zone_set_pageset_high_and_batch(zone); > out: > mutex_unlock(_batch_high_lock); > return ret; > @@ -8746,7 +8740,7 @@ EXPORT_SYMBOL(free_contig_range); > void __meminit zone_pcp_update(struct zone *zone) > { > mutex_lock(_batch_high_lock); > - __zone_pcp_update(zone); > + zone_set_pageset_high_and_batch(zone); > mutex_unlock(_batch_high_lock); > } Acked-by: Pankaj Gupta

Re: [PATCH v3 1/7] mm, page_alloc: clean up pageset high and batch update

2020-11-11 Thread Pankaj Gupta
> + new_batch = max(1UL, new_high / 4); > + if ((new_high / 4) > (PAGE_SHIFT * 8)) > + new_batch = PAGE_SHIFT * 8; > + } else { > + new_batch = zone_batchsize(zone); > + new_high = 6 * new_batch; > + new_batch = max(1UL, 1 * new_batch); > + } > + pageset_update(>pcp, new_high, new_batch); > } > > static void __meminit zone_pageset_init(struct zone *zone, int cpu) Looks good to me. Acked-by: Pankaj Gupta

Re: [PATCH 1/3] md: improve variable names in md_flush_request()

2020-11-10 Thread Pankaj Gupta
Hi Paul, > > This patch improves readability by using better variable names > > in flush request coalescing logic. > > Please do not indent the commit message. o.k > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/md/md.c | 8 > &g

[PATCH 1/3] md: improve variable names in md_flush_request()

2020-11-10 Thread Pankaj Gupta
From: Pankaj Gupta This patch improves readability by using better variable names in flush request coalescing logic. Signed-off-by: Pankaj Gupta --- drivers/md/md.c | 8 drivers/md/md.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/md/md.c b

[PATCH 2/3] md: add comments in md_flush_request()

2020-11-10 Thread Pankaj Gupta
From: Pankaj Gupta Request coalescing logic is dependent on flush time update in other context. This patch adds comments to understand the code flow better. Signed-off-by: Pankaj Gupta --- drivers/md/md.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/md/md.c b/drivers/md

[PATCH 0/3] md: code cleanups

2020-11-10 Thread Pankaj Gupta
From: Pankaj Gupta This patch series does some cleanups during my attempt to understand the code. Pankaj Gupta (3): md: improve variable names in md_flush_request() md: add comments in md_flush_request() md: use current request time as base for ktime comparisons drivers/md/md.c | 12

[PATCH 3/3] md: use current request time as base for ktime comparisons

2020-11-10 Thread Pankaj Gupta
From: Pankaj Gupta Request coalescing logic uses 'prev_flush_start' as base to compare the current request start time. 'prev_flush_start' is updated in other context. This patch changes this by using ktime comparison base to 'req_start' for better readability of code. Signed-off-by: Pankaj

Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-05 Thread Pankaj Gupta
> > This looks good to me. This should solve "-EPERM" return by "__kvm_set_msr" > > . > > > > A question I have, In the case of "kvm_emulate_rdmsr()", for "r" we > > are injecting #GP. > > Is there any possibility of this check to be hit and still result in #GP? > > When I wrote this patch

Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-04 Thread Pankaj Gupta
sr" . A question I have, In the case of "kvm_emulate_rdmsr()", for "r" we are injecting #GP. Is there any possibility of this check to be hit and still result in #GP? int kvm_emulate_rdmsr(struct kvm_vcpu *vcpu) { r = kvm_get_msr(vcpu, ecx, ); /* MSR read failed? See if we should ask user space */ if (r && kvm_get_msr_user_space(vcpu, ecx, r)) { /* Bounce to user space */ return 0; } /* MSR read failed? Inject a #GP */ if (r) { trace_kvm_msr_read_ex(ecx); kvm_inject_gp(vcpu, 0); return 1; } } Apart from the question above, feel free to add: Reviewed-by: Pankaj Gupta

Re: [PATCH v2] mm/list_lru: optimize condition of exiting the loop

2020-11-02 Thread Pankaj Gupta
> > @@ -304,7 +304,7 @@ unsigned long list_lru_walk_node(struct list_lru *lru, > int nid, > nr_to_walk); > spin_unlock(>lock); > > - if (*nr_to_walk <= 0) > + if (!*nr_to_walk) > break; > } > } Acked-by: Pankaj Gupta

Re: [PATCH v2 5/5] mm/memory_hotplug: update comment regarding zone shuffling

2020-10-21 Thread Pankaj Gupta
Cc: Alexander Duyck > Cc: Mel Gorman > Cc: Michal Hocko > Cc: Dave Hansen > Cc: Vlastimil Babka > Cc: Wei Yang > Cc: Oscar Salvador > Cc: Mike Rapoport > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > mm/memory_hotplug.c | 11 --- &g

Re: [PATCH v1 18/29] virtio-mem: factor out calculation of the bit number within the sb_states bitmap

2020-10-20 Thread Pankaj Gupta
> The calculation is already complicated enough, let's limit it to one > location. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 20 +++- > 1 fil

Re: [PATCH v1 17/29] virito-mem: subblock states are specific to Sub Block Mode (SBM)

2020-10-20 Thread Pankaj Gupta
> Let's rename and move accordingly. While at it, rename sb_bitmap to > "sb_states". > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 118 +++

Re: [PATCH v1 16/29] virtio-mem: memory block states are specific to Sub Block Mode (SBM)

2020-10-20 Thread Pankaj Gupta
t;nb_mb_state" to "mb_count" > - "set_mb_state" / "get_mb_state" vs. "mb_set_state" / "mb_get_state" > - Don't use lengthy "enum virtio_mem_smb_mb_state", simply use "uint8_t" > > Cc: "

Re: [PATCH v1 15/29] virito-mem: document Sub Block Mode (SBM)

2020-10-20 Thread Pankaj Gupta
; > s/Device Block Mode (DBM)/Big Block Mode (BBM)/ > Reviewed-by: Pankaj Gupta

Re: [PATCH v1 12/29] virtio-mem: factor out fake-offlining into virtio_mem_fake_offline()

2020-10-20 Thread Pankaj Gupta
> ... which now matches virtio_mem_fake_online(). We'll reuse this > functionality soon. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 34 +++

Re: [PATCH v1 07/29] virtio-mem: generalize virtio_mem_overlaps_range()

2020-10-20 Thread Pankaj Gupta
> Avoid using memory block ids. While at it, use uint64_t for > address/size. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 10 +++--- > 1 file changed,

Re: [PATCH v2] mm/compaction: Rename 'start_pfn' to 'iteration_start_pfn' in compact_zone()

2020-10-19 Thread Pankaj Gupta
goto check_drain; > case ISOLATE_SUCCESS: > update_cached = false; > - last_migrated_pfn = start_pfn; > - ; > + last_migrated_pfn = iteration_start_pfn; > } > > err = migrate_pages(>migratepages, compaction_alloc, Improves readability. Acked-by: Pankaj Gupta

Re: [PATCH v1 08/29] virtio-mem: drop last_mb_id

2020-10-15 Thread Pankaj Gupta
> No longer used, let's drop it. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 4 > 1 file changed, 4 deletions(-) > > diff --git a/drivers/virtio

Re: [PATCH v1 11/29] virtio-mem: use "unsigned long" for nr_pages when fake onlining/offlining

2020-10-15 Thread Pankaj Gupta
> No harm done, but let's be consistent. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > >

Re: [PATCH v1 06/29] virtio-mem: generalize virtio_mem_owned_mb()

2020-10-15 Thread Pankaj Gupta
> Avoid using memory block ids. Rename it to virtio_mem_contains_range(). > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 9 + > 1 file changed, 5 inserti

Re: [PATCH v1 02/29] virtio-mem: simplify calculation in virtio_mem_mb_state_prepare_next_mb()

2020-10-15 Thread Pankaj Gupta
> We actually need one byte less (next_mb_id is exclusive, first_mb_id is > inclusive). Simplify. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 4 ++-- > 1 fi

Re: [PATCH v1 01/29] virtio-mem: determine nid only once using memory_add_physaddr_to_nid()

2020-10-15 Thread Pankaj Gupta
> Let's determine the target nid only once in case we have none specified - > usually, we'll end up with node 0 either way. > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- &

Re: [PATCH v1 04/29] virtio-mem: drop rc2 in virtio_mem_mb_plug_and_add()

2020-10-12 Thread Pankaj Gupta
> Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > drivers/virtio/virtio_mem.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/virtio/virtio_mem.c b/drivers/vir

Re: [PATCH v1 3/5] mm/page_alloc: always move pages to the tail of the freelist in unset_migratetype_isolate()

2020-09-28 Thread Pankaj Gupta
ate freepage with more than pageblock_order, there > * should be no freepage in the range, so we could avoid costly > * pageblock scanning for freepage moving. > +* > +* We didn't actually touch any of the isolated pages, so place them > +* to the tail of the freelist. This is an optimization for memory > +* onlining - just onlined memory won't immediately be considered for > +* allocation. > */ > if (!isolated_page) { > - nr_pages = move_freepages_block(zone, page, migratetype, > NULL); > + nr_pages = move_freepages_block(zone, page, migratetype, true, > + NULL); > __mod_zone_freepage_state(zone, nr_pages, migratetype); > } > set_pageblock_migratetype(page, migratetype); Acked-by: Pankaj Gupta

Re: [PATCH v1 2/5] mm/page_alloc: place pages to tail in __putback_isolated_page()

2020-09-28 Thread Pankaj Gupta
+ to_tail = true; > + else if (is_shuffle_order(order)) > to_tail = shuffle_pick_tail(); > else > to_tail = buddy_merge_likely(pfn, buddy_pfn, page, order); > @@ -3300,7 +3314,7 @@ void __putback_isolated_page(struct page *page, > unsigned int order, int mt) > > /* Return isolated page to tail of freelist. */ > __free_one_page(page, page_to_pfn(page), zone, order, mt, > - FOP_SKIP_REPORT_NOTIFY); > + FOP_SKIP_REPORT_NOTIFY | FOP_TO_TAIL); > } Reviewed-by: Pankaj Gupta

Re: [PATCH v1 4/5] mm/page_alloc: place pages to tail in __free_pages_core()

2020-09-28 Thread Pankaj Gupta
{ > if (unlikely(is_migrate_isolate(migratetype))) { > - free_one_page(zone, page, pfn, 0, migratetype); > + free_one_page(zone, page, pfn, 0, migratetype, > + FOP_NONE); > return; > } > migratetype = MIGRATE_MOVABLE; > @@ -5063,7 +5074,7 @@ static inline void free_the_page(struct page *page, > unsigned int order) > if (order == 0) /* Via pcp? */ > free_unref_page(page); > else > - __free_pages_ok(page, order); > + __free_pages_ok(page, order, FOP_NONE); > } > > void __free_pages(struct page *page, unsigned int order) Acked-by: Pankaj Gupta

Re: [PATCH v1 1/5] mm/page_alloc: convert "report" flag of __free_one_page() to a proper flag

2020-09-28 Thread Pankaj Gupta
E); > spin_unlock(>lock); > } > > @@ -3288,7 +3299,8 @@ void __putback_isolated_page(struct page *page, > unsigned int order, int mt) > lockdep_assert_held(>lock); > > /* Return isolated page to tail of freelist. */ > - __free_one_page(page, page_to_pfn(page), zone, order, mt, false); > + __free_one_page(page, page_to_pfn(page), zone, order, mt, > + FOP_SKIP_REPORT_NOTIFY); > } Reviewed-by: Pankaj Gupta

Re: [PATCH] kernel/resource: make iomem_resource implicit in release_mem_region_adjustable()

2020-09-17 Thread Pankaj Gupta
orton > Cc: Michal Hocko > Cc: Dan Williams > Cc: Jason Gunthorpe > Cc: Kees Cook > Cc: Ard Biesheuvel > Cc: Pankaj Gupta > Cc: Baoquan He > Cc: Wei Yang > Signed-off-by: David Hildenbrand > --- > > Based on next-20200915. Follow up on > &

Re: [PATCH v3 5/7] virtio-mem: try to merge system ram resources

2020-09-10 Thread Pankaj Gupta
Reviewed-by: Pankaj Gupta

Re: [PATCH v3 4/7] mm/memory_hotplug: MEMHP_MERGE_RESOURCE to specify merging of System RAM resources

2020-09-10 Thread Pankaj Gupta
Looks good to me. Reviewed-by: Pankaj Gupta

Re: [PATCH v3 3/7] mm/memory_hotplug: prepare passing flags to add_memory() and friends

2020-09-10 Thread Pankaj Gupta
ed-by: Juergen Gross # Xen related part > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Dan Williams > Cc: Jason Gunthorpe > Cc: Pankaj Gupta > Cc: Baoquan He > Cc: Wei Yang > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: "Ra

Re: [PATCH] Fix khugepaged's request size in collapse_file()

2020-09-02 Thread Pankaj Gupta
end - index); > /* drain pagevecs to help isolate_lru_page() > */ > lru_add_drain(); > page = find_lock_page(mapping, index); > Acked-by: Pankaj Gupta

Re: [PATCH v5 2/3] memremap: rename MEMORY_DEVICE_DEVDAX to MEMORY_DEVICE_GENERIC

2020-09-01 Thread Pankaj Gupta
6dace60b1a 100644 > --- a/mm/memremap.c > +++ b/mm/memremap.c > @@ -216,7 +216,7 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid) > return ERR_PTR(-EINVAL); > } > break; > - case MEMORY_DEVICE_DEVDAX: > + case MEMORY_DEVICE_GENERIC: > need_devmap_managed = false; > break; > case MEMORY_DEVICE_PCI_P2PDMA: Reviewed-by: Pankaj Gupta

Re: [PATCH v1 03/11] mm/memory_hotplug: simplify checking if all pages are isolated in offline_pages()

2020-08-31 Thread Pankaj Gupta
> We make sure that we cannot have any memory holes right at the beginning > of offline_pages(). We no longer need walk_system_ram_range() and can > call test_pages_isolated() directly. > > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Wei Yang > Cc: Baoquan He > Cc

Re: [PATCH v2 01/10] mm/memory_hotplug: inline __offline_pages() into offline_pages()

2020-08-31 Thread Pankaj Gupta
> There is only a single user, offline_pages(). Let's inline, to make > it look more similar to online_pages(). > > Acked-by: Michal Hocko > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Wei Yang > Cc: Baoquan He > Cc: Pankaj Gupta > Cc: Oscar Salvador >

Re: [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail

2020-08-31 Thread Pankaj Gupta
%d, type %lx (%pGp)\n", > pfn, msg_page[huge], ret, page_count(page), > page->flags, >flags); > + ret = -EBUSY; > } > return ret; > } > -- Acked-by: Pankaj Gupta > 2.11.0 > >

Re: [PATCH v1 2/5] kernel/resource: merge_system_ram_resources() to merge resources after hotplug

2020-08-31 Thread Pankaj Gupta
Thomas Gleixner > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Stephen Hemminger > Cc: Wei Liu > Cc: Boris Ostrovsky > Cc: Juergen Gross > Cc: Stefano Stabellini > Cc: Roger Pau Monné > Cc: Julien Grall > Cc: Pankaj Gupta > Cc: Baoquan He &g

Re: [PATCH v3 6/7] libnvdimm: make sure EXPORT_SYMBOL_GPL(nvdimm_flush) close to its function

2020-08-20 Thread Pankaj Gupta
*nd_region) > > return 0; > } > -EXPORT_SYMBOL_GPL(nvdimm_flush); > > /** > * nvdimm_has_flush - determine write flushing requirements > -- Reviewed-by: Pankaj Gupta > 1.8.3 > > ___ > Linux-nvdimm mailing list -- linux-nvd...@lists.01.org > To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-07-29 Thread Pankaj Gupta
> + if (!kvm_arch_interrupt_allowed(vcpu)) > + return false; > + > + /* Found gfn in error gfn cache. Force sync fault */ > + if (kvm_find_and_remove_error_gfn(vcpu, gfn)) > + return false; > + > + return true; > } > > bool kvm_arch_async_page_not_present(struct kvm_vcpu *vcpu, > diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h > index 68e84cf42a3f..677bb8269cd3 100644 > --- a/include/linux/kvm_types.h > +++ b/include/linux/kvm_types.h > @@ -36,6 +36,7 @@ typedef u64gpa_t; > typedef u64gfn_t; > > #define GPA_INVALID(~(gpa_t)0) > +#define GFN_INVALID(~(gfn_t)0) > > typedef unsigned long hva_t; > typedef u64hpa_t; > -- > 2.25.4 This patch looks good to me. Reviewed-by: Pankaj Gupta >

Re: [PATCH] dax: Fix wrong error-number passed into xas_set_err()

2020-07-29 Thread Pankaj Gupta
void *grab_mapping_entry(struct xa_state *xas, > if (dax_is_conflict(entry)) > goto fallback; > if (!xa_is_value(entry)) { > - xas_set_err(xas, EIO); > + xas_set_err(xas, -EIO); > goto ou

Re: [PATCH v1 4/6] mm/page_isolation: cleanup set_migratetype_isolate()

2020-07-29 Thread Pankaj Gupta
; * lockdep splat, so defer it here. > */ > dump_page(unmovable, "unmovable page"); > > - return ret; > + return -EBUSY; > } > > static void unset_migratetype_isolate(struct page *page, unsigned > migratetype) > -- This clean up looks good to me. Reviewed-by: Pankaj Gupta > 2.26.2 > >

Re: [PATCH v1 2/6] mm/page_isolation: don't dump_page(NULL) in set_migratetype_isolate()

2020-07-29 Thread Pankaj Gupta
if (is_migrate_isolate_page(page)) { > + spin_unlock_irqrestore(>lock, flags); > + return -EBUSY; > + } > > /* > * FIXME: Now, memory hotplug doesn't call shrink_slab() by itself. > -- Reviewed-by: Pankaj Gupta > 2.26.2 > >

Re: [PATCH v3 3/6] sh/mm: use default dummy memory_add_physaddr_to_nid()

2020-07-20 Thread Pankaj Gupta
addr_to_nid(u64 addr) > -{ > - /* Node 0 for now.. */ > - return 0; > -} > -EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); > -#endif > - > void arch_remove_memory(int nid, u64 start, u64 size, > struct vmem_altmap *altmap) > { Reviewed-by: Pankaj Gupta

Re: [PATCH] mm/hugetlb: hide nr_nodes in the internal of for_each_node_mask_to_[alloc|free]

2020-07-14 Thread Pankaj Gupta
s_allowed) > { > + for_each_node_mask_to_alloc(h, node, nodes_allowed) { > if (h->surplus_huge_pages_node[node]) > goto found; > } > } else { > - for_each_node_mask_to_free(h, nr_nodes, node, nodes_allowed) { > + for_each_node_mask_to_free(h, node, nodes_allowed) { > if (h->surplus_huge_pages_node[node] < > h->nr_huge_pages_node[node]) > goto found; > -- > 2.20.1 (Apple Git-117) Acked-by: Pankaj Gupta > >

Re: [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages()

2020-06-21 Thread Pankaj Gupta
/* cpuset refresh routine should be here */ > } > - vm_total_pages = nr_free_pagecache_pages(); > + /* Get the number of free pages beyond high watermark in all zones. */ > + vm_total_pages = nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE)); > /* > * Disable grouping by mobility if the number of pages in the > * system is too low to allow the mechanism to work. It would be Reviewed-by: Pankaj Gupta

Re: [PATCH v1 1/2] mm: drop vm_total_pages

2020-06-21 Thread Pankaj Gupta
. 200. Higher means more swappy. > */ > int vm_swappiness = 60; > -/* > - * The total number of pages which are beyond the high watermark within all > - * zones. > - */ > -unsigned long vm_total_pages; > > static void set_task_reclaim_state(struct task_struct *task, >struct reclaim_state *rs) Reviewed-by: Pankaj Gupta

Re: [PATCH v1] MAINTAINERS: add URL for virtio-mem

2020-06-17 Thread Pankaj Gupta
> Let's add the status/info page, which is still under construction, however, > already contains valuable documentation/information. > > Cc: "Michael S. Tsirkin" > Cc: Pankaj Gupta > Signed-off-by: David Hildenbrand > --- > MAINTAINERS | 1 + > 1 file c

Re: [PATCH v1] virtio-mem: add memory via add_memory_driver_managed()

2020-06-11 Thread Pankaj Gupta
ff : virtio0 > 14000-147ff : System RAM (virtio_mem) > 33400-533ff : virtio1 > 33800-33fff : System RAM (virtio_mem) > 340000000-347ff : System RAM (virtio_mem) > 34800-34fff : System RAM (virtio_mem) > [...] > > Cc

Re: [PATCH] virtio-mem: drop unnecessary initialization

2020-06-08 Thread Pankaj Gupta
ete_resource(struct > virtio_mem *vm) > static int virtio_mem_probe(struct virtio_device *vdev) > { > struct virtio_mem *vm; > - int rc = -EINVAL; > + int rc; > > BUILD_BUG_ON(sizeof(struct virtio_mem_req) != 24); > BUILD_BUG_ON(sizeof(struct virtio_mem_resp) != 10); Reviewed-by: Pankaj Gupta

Re: [PATCH 1/2] mm/page_idle.c: Skip offline pages

2020-06-05 Thread Pankaj Gupta
dle_get_page(unsigned long pfn) > { > - struct page *page; > + struct page *page = pfn_to_online_page(pfn); > pg_data_t *pgdat; > > - if (!pfn_valid(pfn)) > - return NULL; > - > - page = pfn_to_page(pfn); > if (!pag

Re: [PATCH] drivers/dax/bus: Use kobj_to_dev() API

2020-06-02 Thread Pankaj Gupta
ice *dev = kobj_to_dev(kobj); > struct dev_dax *dev_dax = to_dev_dax(dev); > > if (a == _attr_target_node.attr && dev_dax_target_node(dev_dax) < > 0) Reviewed-by: Pankaj Gupta

Re: [PATCH v2 2/2] vhost: convert get_user_pages() --> pin_user_pages()

2020-06-02 Thread Pankaj Gupta
!= 1); > base = kmap_atomic(page); > set_bit(bit, base); > kunmap_atomic(base); > - set_page_dirty_lock(page); > - put_page(page); > + unpin_user_pages_dirty_lock(, 1, true); > return 0; > } Acked-by: Pankaj Gupta

Re: [PATCH 1/2] mm/gup: introduce pin_user_pages_locked()

2020-05-31 Thread Pankaj Gupta
Acked-by: Pankaj Gupta On Thu, 28 May 2020 at 00:32, John Hubbard wrote: > > Introduce pin_user_pages_locked(), which is nearly identical to > get_user_pages_locked() except that it sets FOLL_PIN and rejects > FOLL_GET. > > Signed-off-by: John Hubbard > --- > include/

Re: [PATCH] mm/gup: documentation fix for pin_user_pages*() APIs

2020-05-31 Thread Pankaj Gupta
Acked-by: Pankaj Gupta

Re: [PATCH V2] mm, memory_failure: don't send BUS_MCEERR_AO for action required error

2020-05-30 Thread Pankaj Gupta
TION_REQUIRED) { > + if (t->mm == current->mm) > + ret = force_sig_mceerr(BUS_MCEERR_AR, > +(void __user *)tk->addr, addr_lsb); > + /* send no signal to non-current processes */ > } else { > /* > * Don't use force here, it's convenient if the signal > -- Looks good to me. Acked-by: Pankaj Gupta

Re: [PATCH v4 11/15] virtio-mem: Add parent resource for all added "System RAM"

2020-05-07 Thread Pankaj Gupta
] > 33400-3033ff : virtio1 > 33800-33fff : System RAM > 34000-347ff : System RAM > 34800-34fff : System RAM > [...] > > Cc: "Michael S. Tsirkin" > Cc: Pankaj Gupta &

Re: [PATCH v3 1/3] mm/memory_hotplug: Introduce add_memory_device_managed()

2020-05-06 Thread Pankaj Gupta
Looks good to me. Acked-by: Pankaj Gupta

Re: [PATCH v3 3/3] device-dax: Add memory via add_memory_driver_managed()

2020-05-06 Thread Pankaj Gupta
; feffc000-ff00 (Reserved) > fffc-0001 (Reserved) > 0001-00014000 (System RAM) > > kexec-tools already seem to basically ignore any System RAM that's not > on top level when searching for areas to pla

Re: [PATCH v7 3/6] mm: Use zone and order instead of free area in free_list manipulators

2019-09-06 Thread Pankaj Gupta
t_type); > } > > /* > @@ -3113,7 +3106,6 @@ void split_page(struct page *page, unsigned int order) > > int __isolate_free_page(struct page *page, unsigned int order) > { > - struct free_area *area = _zone(page)->free_area[order]; > unsigned long watermark; > struct zone *zone; > int mt; > @@ -3139,7 +3131,7 @@ int __isolate_free_page(struct page *page, unsigned int > order) > > /* Remove page from free list */ > > - del_page_from_free_area(page, area); > + del_page_from_free_list(page, zone, order); > > /* >* Set the pageblock if the isolated page is at least half of a > @@ -8560,7 +8552,7 @@ void zone_pcp_reset(struct zone *zone) > pr_info("remove from free list %lx %d %lx\n", > pfn, 1 << order, end_pfn); > #endif > - del_page_from_free_area(page, >free_area[order]); > + del_page_from_free_list(page, zone, order); > for (i = 0; i < (1 << order); i++) > SetPageReserved((page+i)); > pfn += (1 << order); > > Reviewed-by: Pankaj Gupta >

Re: [PATCH v6 0/6] mm / virtio: Provide support for unused page reporting

2019-08-22 Thread Pankaj Gupta
> On Thu, 2019-08-22 at 06:43 -0400, Pankaj Gupta wrote: > > > This series provides an asynchronous means of reporting to a hypervisor > > > that a guest page is no longer in use and can have the data associated > > > with it dropped. To do this I have impleme

Re: [PATCH v6 0/6] mm / virtio: Provide support for unused page reporting

2019-08-22 Thread Pankaj Gupta
> > This series provides an asynchronous means of reporting to a hypervisor > that a guest page is no longer in use and can have the data associated > with it dropped. To do this I have implemented functionality that allows > for what I am referring to as unused page reporting > > The

Re: [PATCH] libnvdimm: change disk name of virtio pmem disk

2019-08-16 Thread Pankaj Gupta
nd display using ndctl. Thanks, Pankaj > > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/nvdimm/namespace_devs.c | 6 +- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/nvdimm/namespace_devs.c > > b/driver

[PATCH v4 0/2] virtio_console: fix replug of virtio console port

2019-08-13 Thread Pankaj Gupta
s-open.org/archives/virtio-dev/201908/msg00055.html Pankaj Gupta (2): virtio: decrement avail idx with buffer detach for packed ring virtio_console: free unused buffers with port delete char/virtio_console.c | 14 +++--- virtio/virtio_ring.c |6 ++ 2 files changed, 17 insert

[PATCH v4 2/2] virtio_console: free unused buffers with port delete

2019-08-13 Thread Pankaj Gupta
ed with the port. Re-plug the same port tries to allocate new buffers in virtqueue and results in this error if queue is full. This patch reverts this commit by removing the unused buffers in vq's when we unplug the port. Reported-by: Xiaohui Li Cc: sta...@vger.kernel.org Signed-off-by: Pankaj

[PATCH v4 1/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-13 Thread Pankaj Gupta
. Acked-by: Jason Wang Signed-off-by: Pankaj Gupta --- drivers/virtio/virtio_ring.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..7c69181113e2 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio

Re: [PATCH] libnvdimm: change disk name of virtio pmem disk

2019-08-12 Thread Pankaj Gupta
Ping. > > This patch adds prefix 'v' in disk name for virtio pmem. > This differentiates virtio-pmem disks from the pmem disks. > > Signed-off-by: Pankaj Gupta > --- > drivers/nvdimm/namespace_devs.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) &

Re: [PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-11 Thread Pankaj Gupta
> > On 2019/8/9 下午2:48, Pankaj Gupta wrote: > > This patch decrements 'next_avail_idx' count when detaching a buffer > > from vq for packed ring code. Split ring code already does this in > > virtqueue_detach_unused_buf_split function. This updates the > > 'n

Re: [PATCH v3 1/2] virtio_console: free unused buffers with port delete

2019-08-11 Thread Pankaj Gupta
> > On Fri, Aug 09, 2019 at 12:18:46PM +0530, Pankaj Gupta wrote: > > The commit a7a69ec0d8e4 ("virtio_console: free buffers after reset") > > deferred detaching of unused buffer to virtio device unplug time. > > This causes unplug/replug of single port in virt

Re: [PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-11 Thread Pankaj Gupta
> On Fri, Aug 09, 2019 at 12:18:47PM +0530, Pankaj Gupta wrote: > > This patch decrements 'next_avail_idx' count when detaching a buffer > > from vq for packed ring code. Split ring code already does this in > > virtqueue_detach_unused_buf_split function. This updates th

[PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-09 Thread Pankaj Gupta
. Signed-off-by: Pankaj Gupta --- drivers/virtio/virtio_ring.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..7c69181113e2 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1537,6

[PATCH v3 1/2] virtio_console: free unused buffers with port delete

2019-08-09 Thread Pankaj Gupta
orted-by: Xiaohui Li Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") Cc: sta...@vger.kernel.org Signed-off-by: Pankaj Gupta --- drivers/char/virtio_console.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/char/v

[PATCH v3 0/2] virtio_console: fix replug of virtio console port

2019-08-09 Thread Pankaj Gupta
1883703948=2 [2] https://lkml.org/lkml/2019/3/4/517 Pankaj Gupta (2): virtio_console: free unused buffers with port delete virtio: decrement avail idx with buffer detach for packed ring char/virtio_console.c | 14 +++--- virtio/virtio_ring.c |6 ++ 2 files changed, 17

Re: [PATCH v2 2/2] virtio_ring: packed ring: fix virtqueue_detach_unused_buf

2019-08-08 Thread Pankaj Gupta
> On Thu, Aug 08, 2019 at 08:28:46AM -0400, Pankaj Gupta wrote: > > > > > > > > This patch makes packed ring code compatible with split ring in > > > > function > > > > 'virtqueue_detach_unused_buf_*'. > > > > > > What does

  1   2   3   4   5   >