On Tue, May 08, 2018 at 08:11:23PM +0800, Baoquan He wrote:
>On 05/08/18 at 08:48pm, Wei Yang wrote:
>> On Mon, May 07, 2018 at 09:14:29AM +0800, Baoquan He wrote:
>> >Hi Wei Yang,
>> >
>> >On 04/26/18 at 09:18am, Wei Yang wrote:
>> >> On Thu, Ap
On Mon, May 07, 2018 at 09:14:29AM +0800, Baoquan He wrote:
>Hi Wei Yang,
>
>On 04/26/18 at 09:18am, Wei Yang wrote:
>> On Thu, Apr 19, 2018 at 08:18:46AM +0800, Baoquan He wrote:
>> >The struct resource uses singly linked list to link siblings. It's not
>> >easy t
proposal of resource reverse iteration without changing current
design.
>From 5d7145d44fe48b98572a03884fa3a3aa82e3cef9 Mon Sep 17 00:00:00 2001
From: Wei Yang <richard.weiy...@gmail.com>
Date: Sat, 24 Mar 2018 23:25:46 +0800
Subject: [PATCH] kernel/resource: add walk_system_ram_res_rev()
As
On Fri, Jan 18, 2019 at 12:38:18AM -0800, Dan Williams wrote:
>On Thu, Jan 17, 2019 at 11:31 PM Wei Yang
>wrote:
>>
>> On Thu, Jan 17, 2019 at 09:05:54PM -0800, Dan Williams wrote:
>> >On Thu, Jan 17, 2019 at 9:03 PM Wei Yang
>> >wrote:
>> >>
>
On Fri, Jan 18, 2019 at 10:59:23AM -0800, Dan Williams wrote:
>On Fri, Jan 18, 2019 at 12:38 AM Dan Williams wrote:
>>
>> On Thu, Jan 17, 2019 at 11:31 PM Wei Yang
>> wrote:
>> >
>> > On Thu, Jan 17, 2019 at 09:05:54PM -0800, Dan Williams wrote:
>>
We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to
ndr_desc, while the assignment is done twice in this function.
This patch removes the first assignment. No functional change.
Signed-off-by: Wei Yang
---
v2:
* remove the first assignment to avoid some leak
---
drivers
On Sun, Jan 13, 2019 at 08:41:11PM -0800, Dan Williams wrote:
>On Sun, Jan 13, 2019 at 6:19 PM Wei Yang wrote:
>>
>> We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to
>> ndr_desc, while the assignment is done twice in this function.
>>
>&
up. This
is not necessary to reset variable *nfit_mem* to *found* again.
This patch removes the assignment of *nfit_mem* to *found* when they are
the same.
Signed-off-by: Wei Yang
---
drivers/acpi/nfit/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit
ves the check immediately after uuid allocation.
Signed-off-by: Wei Yang
---
drivers/nvdimm/namespace_devs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 681af3a8fd62..9471b9ca04f5 100644
--- a/driv
t reads through this code in
>the future.
>
>Reported-by: Wei Yang
>Signed-off-by: Dan Williams
>---
> drivers/nvdimm/btt_devs.c |5 +
> drivers/nvdimm/dax_devs.c |5 +
> drivers/nvdimm/pfn_devs.c | 21 +
> 3 files changed, 31 insertions(+)
On Mon, Jan 21, 2019 at 10:04:40AM -0800, Dan Williams wrote:
>On Sun, Jan 20, 2019 at 11:51 PM Wei Yang
>wrote:
>> On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote:
>[..]
>> Also, I have one confusion about your saying: two probes.
>>
>> If the two
On Mon, Jan 21, 2019 at 04:29:08PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 4:26 PM Wei Yang wrote:
>[..]
>> >@@ -706,6 +711,22 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)
>> > sig = DAX_SIG;
>> > else
On Mon, Jan 21, 2019 at 02:34:06PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 12:57 PM Wei Yang wrote:
>>
>> On Mon, Jan 21, 2019 at 10:04:40AM -0800, Dan Williams wrote:
>> >On Sun, Jan 20, 2019 at 11:51 PM Wei Yang
>> >wrote:
>> >>
On Mon, Jan 21, 2019 at 03:51:02PM +0800, Wei Yang wrote:
>On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote:
>>In recent days, 2 engineers, including the original author of
>>nd_pfn_init(), overlooked the internal call to nd_pfn_validate() and the
>>implications
There are two places to calculate npfns in nd_pfn_init(), while they use
difference size to calculate.
Use PAGE_SIZE would be more proper for calculation.
Signed-off-by: Wei Yang
---
drivers/nvdimm/pfn_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvdimm
When trying to see whether current nd_region intersects with others, we
have already calculated the *size* to be expanded to SECTION size.
So just pass size is enough.
Signed-off-by: Wei Yang
---
drivers/nvdimm/pfn_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
On Mon, Jan 21, 2019 at 04:45:46PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 4:30 PM Wei Yang wrote:
>>
>>
>> May I ask a question about the purpose to create these three device here?
>>
>> I see nd_pfn_create() doesn't allocate pfn_sb here, and the
t reads through this code in
>the future.
>
>Reported-by: Wei Yang
>Signed-off-by: Dan Williams
>---
> drivers/nvdimm/btt_devs.c |5 +
> drivers/nvdimm/dax_devs.c |5 +
> drivers/nvdimm/pfn_devs.c | 21 +
> 3 files changed, 31 insertions(+)
t reads through this code in
>the future.
>
>Reported-by: Wei Yang
>Signed-off-by: Dan Williams
>---
> drivers/nvdimm/btt_devs.c |5 +
> drivers/nvdimm/dax_devs.c |5 +
> drivers/nvdimm/pfn_devs.c | 21 +
> 3 files changed, 31 insertions(+)
On Thu, Jan 17, 2019 at 08:31:56PM -0800, Dan Williams wrote:
>On Thu, Jan 17, 2019 at 7:36 PM Wei Yang wrote:
>>
>> In current implementation, we might re-allocate nd_pfn->pfn_sb.
>>
>> For example:
>>
>> nd_dax_probe()
>> nd_pfn-&
n->pfn_sb before allocating it in nd_pfn_init().
Signed-off-by: Wei Yang
---
drivers/nvdimm/pfn_devs.c | 14 +-
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 6f22272e8d80..1f4f07007483 100644
--- a/dr
On Thu, Jan 17, 2019 at 09:05:54PM -0800, Dan Williams wrote:
>On Thu, Jan 17, 2019 at 9:03 PM Wei Yang wrote:
>>
>> On Thu, Jan 17, 2019 at 08:31:56PM -0800, Dan Williams wrote:
>> >On Thu, Jan 17, 2019 at 7:36 PM Wei Yang
>> >wrote:
>> >>
>>
On Tue, Jan 22, 2019 at 05:27:29PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 6:49 PM Wei Yang wrote:
>>
>> There are two places to calculate npfns in nd_pfn_init(), while they use
>> difference size to calculate.
>>
>> Use PAGE_SIZE wou
On Tue, Jan 22, 2019 at 05:28:39PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 6:49 PM Wei Yang wrote:
>>
>> When trying to see whether current nd_region intersects with others, we
>> have already calculated the *size* to be expanded to SECTION size.
>>
>
We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to
ndr_desc, while the assignment is done twice in this function.
This patch removes the second assignment. No functional change.
Signed-off-by: Wei Yang
---
drivers/acpi/nfit/core.c | 1 -
1 file changed, 1 deletion(-)
diff
This is a preparation for next patch, so that init_active_labels not too
huge.
Signed-off-by: Wei Yang
---
drivers/nvdimm/namespace_devs.c | 41 -
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm
the memory allocation in scan_labels().
Signed-off-by: Wei Yang
---
drivers/nvdimm/namespace_devs.c | 29 +
drivers/nvdimm/nd.h | 1 +
drivers/nvdimm/region_devs.c| 1 +
3 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/drivers/nvdimm
This is reasonable to continue directly when count == 0, while this case
could be merged in following for loop.
count == 0, j == 0 => j >= count, loop continues.
This patch just removes the special handling to make the code look more
neat.
Signed-off-by: Wei Yang
---
drivers/
In nd_label_active(), we get nd_label from label area. While it is not
necessary to calculate it a second time.
This patch return nd_label directly.
Signed-off-by: Wei Yang
---
drivers/nvdimm/label.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvdimm/label.c b
* just labels on current nd_mapping released, previous ones are lost
This patch extracts labels releasing code to error branch and release
labels on all nd_mapping besides only current one. By goto error branch
on error, it release all labels allocated.
Signed-off-by: Wei Yang
---
drivers/nvdimm
On Tue, Jan 22, 2019 at 05:28:39PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 6:49 PM Wei Yang wrote:
>>
>> When trying to see whether current nd_region intersects with others, we
>> have already calculated the *size* to be expanded to SECTION size.
>>
>
On Mon, Jan 28, 2019 at 08:30:14AM +0800, Wei Yang wrote:
>In init_active_labels(), it iterates on ndr_mappings to create its
>corresponding labels. When there is an error, it is supposed to release
>those labels created. But current implementation doesn't handle this
>well in
Hi, Dan
Do you have some time on this?
On Wed, Jan 16, 2019 at 02:51:44PM +0800, Wei Yang wrote:
>When creating nd_namespace_blk, its uuid is copied from nd_label->uuid.
>In case the memory allocation fails, it goes to the error branch.
>
>This check is better to be done immediate
ed-by: Oscar Salvador
>Reviewed-by: Pavel Tatashin
>Signed-off-by: Dan Williams
Reviewed-by: Wei Yang
>---
> include/linux/mmzone.h | 12
> mm/page_alloc.c|2 +-
> 2 files changed, 1 insertion(+), 13 deletions(-)
>
>diff --git a/include/l
r (; pfn < pgdat_end_pfn; pfn += PAGES_PER_SECTION) {
>- ms = __pfn_to_section(pfn);
>-
>- if (unlikely(!valid_section(ms)))
>+ for (; pfn < pgdat_end_pfn; pfn += PAGES_PER_SUBSECTION) {
>+ if (unlikely(!pfn_valid(pfn)))
>
On Mon, Jun 17, 2019 at 03:32:45PM -0700, Dan Williams wrote:
>On Mon, Jun 17, 2019 at 3:22 PM Wei Yang wrote:
>>
>> On Wed, Jun 05, 2019 at 02:57:59PM -0700, Dan Williams wrote:
>> >Prepare for hot{plug,remove} of sub-ranges of a section by tracking a
>> >sub
t;+ pfns = min(nr_pages, PAGES_PER_SECTION
>+ - (pfn & ~PAGE_SECTION_MASK));
>+ ms = __nr_to_section(i);
>+ subsection_mask_set(ms->usage->subsection_map, pfn, pfns);
>+
>+ pr_debug("%s: sec: %d pfns: %l
On Tue, Jun 18, 2019 at 02:56:09PM -0700, Dan Williams wrote:
>On Sun, Jun 16, 2019 at 6:11 AM Wei Yang wrote:
>>
>> On Wed, Jun 05, 2019 at 02:57:54PM -0700, Dan Williams wrote:
>> >Towards enabling memory hotplug to track partial population of a
>> >section, in
map)
>+ if (!usage)
> return;
>
>- usemap_page = virt_to_page(usemap);
>+ usage_page = virt_to_page(usage);
> /*
>* Check to see if allocation came from hot-plug-add
>*/
>- if (PageSlab(usemap_page) || PageCompound(usemap_page)) {
>- kfree(usemap);
>+ if (PageSlab(usage_page) || PageCompound(usage_page)) {
>+ kfree(usage);
> if (memmap)
> __kfree_section_memmap(memmap, altmap);
> return;
>@@ -804,18 +803,18 @@ void sparse_remove_one_section(struct mem_section *ms,
>unsigned long map_offset,
> struct vmem_altmap *altmap)
> {
> struct page *memmap = NULL;
>- unsigned long *usemap = NULL;
>+ struct mem_section_usage *usage = NULL;
>
> if (ms->section_mem_map) {
>- usemap = ms->pageblock_flags;
>+ usage = ms->usage;
> memmap = sparse_decode_mem_map(ms->section_mem_map,
> __section_nr(ms));
> ms->section_mem_map = 0;
>- ms->pageblock_flags = NULL;
>+ ms->usage = NULL;
> }
>
> clear_hwpoisoned_pages(memmap + map_offset,
> PAGES_PER_SECTION - map_offset);
>- free_section_usemap(memmap, usemap, altmap);
>+ free_section_usage(memmap, usage, altmap);
> }
> #endif /* CONFIG_MEMORY_HOTPLUG */
--
Wei Yang
Help you, Help me
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
On Tue, Sep 15, 2020 at 11:15:53AM +0200, David Hildenbrand wrote:
>On 15.09.20 11:06, Wei Yang wrote:
>> On Tue, Sep 15, 2020 at 09:35:30AM +0200, David Hildenbrand wrote:
>>>
>>>>> static int __ref try_remove_memory(int nid, u64 start, u64 size)
>>>
or
>
>#define devm_release_mem_region(dev, start, n) \
> __devm_release_region(dev, _resource, (start), (n))
>
What I prefer is remove iomem_resource from the parameter list. Just use is in
the function body.
For the example you listed, __release_region() would have varies of *paren
licable.
>
Looks good to me.
Reviewed-by: Wei Yang
>Suggested-by: Wei Yang
>Cc: Andrew Morton
>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:
: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Signed-off-by: David Hildenbrand
>---
> include/linux/ioport.h | 4 ++--
> kernel/resource.c | 49 --
> mm/memory_hotplug.c| 22 +--
&
: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Signed-off-by: David Hildenbrand
>---
> include/linux/ioport.h | 4 ++--
> kernel/resource.c | 49 --
> mm/memory_hotplug.c| 22 +--
&
pluged memory? So we make them all in IORESOURCE_SYSRAM_XXX family?
>
>Cc: Andrew Morton
>Cc: Michal Hocko
>Cc: Dan Williams
>Cc: Jason Gunthorpe
>Cc: Kees Cook
>Cc: Ard Biesheuvel
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Cc: Wei Yang
>Cc: Eric Biederman
>Cc: Thomas Gle
"
>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
>Cc: Wei Yang
>Signed-off-by: David Hild
elease_mem_region_adjustable()
>never fail")
>Link: https://github.com/ClangBuiltLinux/linux/issues/1159
>Signed-off-by: Nathan Chancellor
Reviewed-by: Wei Yang
>---
>
>Presumably, this will be squashed but I included a fixes tag
>nonetheless. Apologies if this has already been n
Andrew Morton
>Cc: Michal Hocko
>Cc: Dan Williams
>Cc: Michael S. Tsirkin
>Cc: Jason Wang
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/virtio/virtio_mem.c | 3 ++-
> 1 file changed, 2 insertions(+
c: Juergen Gross
>Cc: Stefano Stabellini
>Cc: Roger Pau Monné
>Cc: Julien Grall
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> include/linux/ioport.h | 4 +++
> include/linux/memory_hotplug.h | 7
>Cc: Michal Hocko
>Cc: "K. Y. Srinivasan"
>Cc: Haiyang Zhang
>Cc: Stephen Hemminger
>Cc: Wei Liu
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/hv/hv_balloon.c | 2 +-
> 1 file chan
On Wed, Sep 16, 2020 at 12:03:20PM +0200, David Hildenbrand wrote:
>On 16.09.20 12:02, Wei Yang wrote:
>> On Wed, Sep 16, 2020 at 09:30:41AM +0200, David Hildenbrand wrote:
>>> "mem" in the name already indicates the root, similar to
>>> release_mem_region(
orton
>Cc: Michal Hocko
>Cc: Boris Ostrovsky
>Cc: Juergen Gross
>Cc: Stefano Stabellini
>Cc: Roger Pau Monné
>Cc: Julien Grall
>Cc: Pankaj Gupta
>Cc: Baoquan He
>Signed-off-by: David Hildenbrand
Reviewed-by: Wei Yang
>---
> drivers/xen/balloon.c
On Wed, Sep 16, 2020 at 02:16:25PM +0200, David Hildenbrand wrote:
>On 16.09.20 14:10, Wei Yang wrote:
>> On Wed, Sep 16, 2020 at 12:03:20PM +0200, David Hildenbrand wrote:
>>> On 16.09.20 12:02, Wei Yang wrote:
>>>> On Wed, Sep 16, 2020 at 09:30:41AM +0200, David
53 matches
Mail list logo