[PATCH v2] perf vendor events amd: remove trailing commas

2020-09-14 Thread Henry Burns
amdzen2/core.json and amdzen/core.json have the occasional trailing comma. Since that goes against the JSON standard, lets remove it. Signed-off-by: Henry Burns --- tools/perf/pmu-events/arch/x86/amdzen1/core.json | 2 +- tools/perf/pmu-events/arch/x86/amdzen2/core.json | 2 +- 2 files changed

Re: [PATCH] perf vendor events amd: remove trailing comma

2020-09-14 Thread Henry Burns
, and found one other instance in amdzen1. I'll send an updated patch now. > > - Arnaldo > > > Signed-off-by: Henry Burns > > --- > > tools/perf/pmu-events/arch/x86/amdzen2/core.json | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > dif

[PATCH] perf vendor events amd: remove trailing comma

2020-09-11 Thread Henry Burns
amdzen2/core.json had a trailing comma on the x_ret_fus_brnch_inst event. Since that goes against the JSON standard, lets remove it. Signed-off-by: Henry Burns --- tools/perf/pmu-events/arch/x86/amdzen2/core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/pmu

Re: [PATCH 2/2 v2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-23 Thread Henry Burns
On Thu, Aug 22, 2019 at 7:23 PM Andrew Morton wrote: > > On Tue, 20 Aug 2019 11:59:39 +0900 Sergey Senozhatsky > wrote: > > > On (08/09/19 11:17), Henry Burns wrote: > > > In zs_destroy_pool() we call flush_work(&pool->free_work). However, we > >

[PATCH v2] mm/z3fold.c: Fix race between migration and destruction

2019-08-09 Thread Henry Burns
kqueue. Signed-off-by: Henry Burns --- Changelog since v1: - Fixed a bug where migration could still queue work after we have waited for it to drain. (added z3fold_pool->destroying in the process) mm/z3fold.c | 89 + 1 file chan

Re: [PATCH] mm/z3fold.c: Fix race between migration and destruction

2019-08-09 Thread Henry Burns
I've just CC'd a personal email here so that I can respond to any replies after today. On Fri, Aug 9, 2019 at 9:46 AM Henry Burns wrote: > > In z3fold_destroy_pool() we call destroy_workqueue(&pool->compact_wq). > However, we have no guarantee that migration isn'

[PATCH 2/2 v2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-09 Thread Henry Burns
quot;zsmalloc: page migration support") Signed-off-by: Henry Burns --- Changelog since v1: - Changed the class level isolated count to a pool level isolated count (of zspages). Also added a pool level flag for when destruction starts and a memory barrier to ensure this flag has

[PATCH 1/2 v2] mm/zsmalloc.c: Migration can leave pages in ZS_EMPTY indefinitely

2019-08-09 Thread Henry Burns
. Fixes: 48b4800a1c6a ("zsmalloc: page migration support") Signed-off-by: Henry Burns --- Changelog since v1: - Moved the comment from putback_zspage_deferred() to zs_page_putback(). mm/zsmalloc.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff

[PATCH] mm/z3fold.c: Fix race between migration and destruction

2019-08-09 Thread Henry Burns
kqueue. Signed-off-by: Henry Burns --- mm/z3fold.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/mm/z3fold.c b/mm/z3fold.c index 78447cecfffa..e136d97ce56e 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -40,6 +40,7 @@ #include #inc

Re: [PATCH 2/2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-06 Thread Henry Burns
By the way, I will lose access to this email in 3 days, so I've cc'd a personal email. On Mon, Aug 5, 2019 at 6:38 PM Minchan Kim wrote: > On Mon, Aug 05, 2019 at 10:34:41AM -0700, Henry Burns wrote: > > On Sun, Aug 4, 2019 at 9:28 PM Minchan Kim wrote: > > > On Thu

Re: [PATCH 2/2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-05 Thread Henry Burns
On Sun, Aug 4, 2019 at 9:28 PM Minchan Kim wrote: > > Hi Henry, > > On Thu, Aug 01, 2019 at 06:53:32PM -0700, Henry Burns wrote: > > In zs_destroy_pool() we call flush_work(&pool->free_work). However, we > > have no guarantee that migration isn't happenin

[PATCH 1/2] mm/zsmalloc.c: Migration can leave pages in ZS_EMPTY indefinitely

2019-08-01 Thread Henry Burns
. Signed-off-by: Henry Burns --- mm/zsmalloc.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 1cda3fe0c2d9..efa660a87787 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1901,6 +1901,22 @@ static void

[PATCH 2/2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-01 Thread Henry Burns
) fails for fully-free zspages). This means it is sufficient to track a "# isolated zspages" count by class, and have the destroy logic ensure all such pages have drained before proceeding. Keeping that state under the class spinlock keeps the logic straightforward. Signed-off-by: Henr

Re: [PATCH] mm/z3fold.c: Fix z3fold_destroy_pool() race condition

2019-07-29 Thread Henry Burns
means that there can be allocated pages referencing a freed inode, causing any thread in compaction to be able to trip over the bad pointer in PageMovable(). Fixes: 1f862989b04a ("mm/z3fold.c: support page migration") Signed-off-by: Henry Burns > Reviewed-by: Shakeel Butt > Revie

Re: [PATCH] mm/z3fold.c: Fix z3fold_destroy_pool() ordering

2019-07-29 Thread Henry Burns
se_z3fold_page(zhdr, ...) queue_work_on(pool->release_wq, &pool->work) *BOOM* So compact_wq needs to be destroyed before release_wq. Fixes: 5d03a6613957 ("mm/z3fold.c: use kref to prevent page free/compact race") Signed-off-by: Henry Burns > Reviewed-by: Shakeel But

[PATCH] mm/z3fold.c: Fix z3fold_destroy_pool() ordering

2019-07-26 Thread Henry Burns
se_z3fold_page(zhdr, ...) queue_work_on(pool->release_wq, &pool->work) *BOOM* So compact_wq needs to be destroyed before release_wq. Fixes: 5d03a6613957 ("mm/z3fold.c: use kref to prevent page free/compact race") Signed-off-by: Henry Burns Cc: --- mm/z3fold.c | 9 ++

[PATCH] mm/z3fold.c: Fix z3fold_destroy_pool() race condition

2019-07-26 Thread Henry Burns
means that there can be allocated pages referencing a freed inode, causing any thread in compaction to be able to trip over the bad pointer in PageMovable(). Fixes: 1f862989b04a ("mm/z3fold.c: support page migration") Signed-off-by: Henry Burns Cc: --- mm/z3fold.c | 5 - 1 file

[PATCH v2] mm/z3fold.c: Reinitialize zhdr structs after migration

2019-07-15 Thread Henry Burns
empty Additionally it is possible that zhdr->work has been placed in a workqueue. In this case we shouldn't migrate the page, as zhdr->work references zhdr as opposed to new_zhdr. Fixes: bba4c5f96ce4 ("mm/z3fold.c: support page migration") Signed-off-by: Henry Burns --- C

Re: [PATCH] mm/z3fold.c: Reinitialize zhdr structs after migration

2019-07-15 Thread Henry Burns
Sorry Vitaly, I had the wrong impression from your email that INIT_LIST_HEAD() was being ensured directly in migrate and got confused. (I thought you were saying it happened through the call to do_compact_page() queued). That being said, I don't see where in migrate new_zhdr->buddy is being checke

Re: [PATCH] mm/z3fold.c: Reinitialize zhdr structs after migration

2019-07-15 Thread Henry Burns
age() already ensures >> that these lists are empty. >> >> Additionally it is possible that zhdr->work has been placed in a >> workqueue. In this case we shouldn't migrate the page, as zhdr->work >> references zhdr as opposed to new_zhdr. >> >> F

[PATCH] mm/z3fold.c: Reinitialize zhdr structs after migration

2019-07-15 Thread Henry Burns
empty. Additionally it is possible that zhdr->work has been placed in a workqueue. In this case we shouldn't migrate the page, as zhdr->work references zhdr as opposed to new_zhdr. Fixes: bba4c5f96ce4 ("mm/z3fold.c: support page migration") Signed-off-by: Henry Burns --- mm/z

[PATCH] mm/z3fold.c: Allow __GFP_HIGHMEM in z3fold_alloc

2019-07-12 Thread Henry Burns
kernel allocation. Signed-off-by: Henry Burns --- mm/z3fold.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index e78f95284d7c..cb567ddf051c 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -193,7 +193,8 @@ static inline struct z3fold_buddy_slots

Re: [PATCH] mm/z3fold.c: remove z3fold_migration trylock

2019-07-10 Thread Henry Burns
> > a_ops->migrate_page(oldpage, newpage) > > z3fold_page_migrate(oldpage, newpage) > > trylock_page(oldpage) > > > > > > Signed-off-by: Henry Burns > > Reviewed-by: Shakeel Butt > > Please add the Fixes tag as well. Fixes: 1f862989b0

[PATCH] mm/z3fold.c: remove z3fold_migration trylock

2019-07-10 Thread Henry Burns
age) z3fold_page_migrate(oldpage, newpage) trylock_page(oldpage) Signed-off-by: Henry Burns --- mm/z3fold.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 985732c8b025..9fe9330ab8ae 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -1335,16 +1335,11 @@ static

Re: [PATCH] mm/z3fold: Fix z3fold_buddy_slots use after free

2019-07-03 Thread Henry Burns
> > On Tue, Jul 2, 2019 at 12:45 AM Vitaly Wool wrote: > > > > > > Hi Henry, > > > > > > On Mon, Jul 1, 2019 at 8:31 PM Henry Burns wrote: > > > > > > > > Running z3fold stress testing with address sanitiz

Re: [PATCH v2] mm/z3fold.c: Lock z3fold page before __SetPageMovable()

2019-07-03 Thread Henry Burns
On Tue, Jul 2, 2019 at 10:54 PM Vitaly Wool wrote: > > On Wed, Jul 3, 2019 at 12:24 AM Andrew Morton > wrote: > > > > On Tue, 2 Jul 2019 15:17:47 -0700 Henry Burns wrote: > > > > > > > > > + if (can_sleep

Re: [PATCH v2] mm/z3fold.c: Lock z3fold page before __SetPageMovable()

2019-07-02 Thread Henry Burns
On Tue, Jul 2, 2019 at 2:19 PM Andrew Morton wrote: > > On Mon, 1 Jul 2019 18:16:30 -0700 Henry Burns wrote: > > > Cc: Vitaly Wool , Vitaly Vul > > Are these the same person? I Think it's the same person, but i wasn't sure which email to include because one was i

[PATCH v3] mm/z3fold.c: Lock z3fold page before __SetPageMovable()

2019-07-02 Thread Henry Burns
Following zsmalloc.c's example we call trylock_page() and unlock_page(). Also make z3fold_page_migrate() assert that newpage is passed in locked, as per the documentation. Link: http://lkml.kernel.org/r/20190702005122.41036-1-henrybu...@google.com Signed-off-by: Henry Burns Suggested-by: V

Re: [PATCH] mm/z3fold: Fix z3fold_buddy_slots use after free

2019-07-02 Thread Henry Burns
On Tue, Jul 2, 2019 at 12:45 AM Vitaly Wool wrote: > > Hi Henry, > > On Mon, Jul 1, 2019 at 8:31 PM Henry Burns wrote: > > > > Running z3fold stress testing with address sanitization > > showed zhdr->slots was being used after it was freed. > &

Re: [PATCH v2] mm/z3fold.c: Lock z3fold page before __SetPageMovable()

2019-07-01 Thread Henry Burns
On Mon, Jul 1, 2019 at 6:00 PM Shakeel Butt wrote: > > On Mon, Jul 1, 2019 at 5:51 PM Henry Burns wrote: > > > > __SetPageMovable() expects it's page to be locked, but z3fold.c doesn't > > lock the page. Following zsmalloc.c's example we call trylock_p

[PATCH v2] mm/z3fold.c: Lock z3fold page before __SetPageMovable()

2019-07-01 Thread Henry Burns
__SetPageMovable() expects it's page to be locked, but z3fold.c doesn't lock the page. Following zsmalloc.c's example we call trylock_page() and unlock_page(). Also makes z3fold_page_migrate() assert that newpage is passed in locked, as documentation. Signed-off-by: Henry Burn

[PATCH] mm/z3fold.c: Lock z3fold page before __SetPageMovable()

2019-07-01 Thread Henry Burns
__SetPageMovable() expects it's page to be locked, but z3fold.c doesn't lock the page. Following zsmalloc.c's example we call trylock_page() and unlock_page(). Also makes z3fold_page_migrate() assert that newpage is passed in locked, as documentation. Signed-off-by: Henry Burns -

[PATCH] mm/z3fold: Fix z3fold_buddy_slots use after free

2019-07-01 Thread Henry Burns
done. Fixes: 7c2b8baa61fe ("mm/z3fold.c: add structure for buddy handles") Signed-off-by: Henry Burns --- mm/z3fold.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index f7993ff778df..e174d1549734 100644 ---