[PATCH 00/11] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-04-19 Thread Baolin Wang
type for posix_clock_operations and k_clock structure. Also introduces some new functions with timespec64/itimerspec64 type, like current_kernel_time64(), hrtimer_get_res64(), cputime_to_timespec64() and timespec64_to_cputime(). Baolin Wang (11): linux/time64.h:Introduce the 'struct itimers

[PATCH 01/11] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit

2015-04-19 Thread Baolin Wang
This patch introduces the 'struct itimerspec64' for 64bit to replace itimerspec, and also introduces the conversion methods: itimerspec64_to_itimerspec() and itimerspec_to_itimerspec64(), that makes itimerspec to ready for 2038 year. Signed-off-by: Baolin Wang --- include/linux/time6

[PATCH 02/11] timekeeping:Introduce the current_kernel_time64() function with timespec64 type

2015-04-19 Thread Baolin Wang
easily in timekeeping.h file. That is ready for 2038 when get the current time. Signed-off-by: Baolin Wang --- include/linux/timekeeping.h | 10 +- kernel/time/timekeeping.c |6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/linux/timekeeping.h b/inc

[PATCH 03/11] time/hrtimer:Introduce hrtimer_get_res64() with timespec64 type for getting the timer resolution

2015-04-19 Thread Baolin Wang
olution by hrtimer_get_res64() function with timespec64 type, and it is convenient to delete the old hrtimer_get_res() function in hrtimer.h file. Signed-off-by: Baolin Wang --- include/linux/hrtimer.h | 12 +++- kernel/time/hrtimer.c | 10 +- 2 files changed, 16 insert

[PATCH 04/11] posix timers:Introduce the 64bit methods with timespec64 type for k_clock structure

2015-04-19 Thread Baolin Wang
framework functions. Next step will migrate all the k_clock users to use the new methods with timespec64 type nd itimerspec64 type, and it contains the files of posix-timers.c, mmtimer.c, alarmtimer.c, posix-clock.c and posix-cpu-timers.c. Signed-off-by: Baolin Wang --- include/linux/posix

[PATCH 05/11] time/posix-timers:Convert to the 64bit methods for k_clock callback functions

2015-04-19 Thread Baolin Wang
. Signed-off-by: Baolin Wang --- include/linux/timekeeping.h |4 +- kernel/time/posix-timers.c | 102 +++ kernel/time/timekeeping.h |2 +- 3 files changed, 57 insertions(+), 51 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux

[PATCH 06/11] char/mmtimer:Convert to the 64bit methods for k_clock callback function

2015-04-19 Thread Baolin Wang
This patch converts to the 64bit methods for k_clock callback function, that converts the timespec type to timespec64 type and converts the itimerspec type to itimerspec64 type. Signed-off-by: Baolin Wang --- drivers/char/mmtimer.c | 36 +--- 1 file changed, 17

[PATCH 07/11] time/alarmtimer:Convert to the new methods for k_clock structure

2015-04-19 Thread Baolin Wang
This patch changes to the new methods with timespec64/itimerspec64 type of k_clock structure, and converts the timespec/itimerspec type to timespec64/itimerspec64 typein alarmtimer.c file. Signed-off-by: Baolin Wang --- kernel/time/alarmtimer.c | 43

[PATCH 08/11] time/posix-clock:Convert to the 64bit methods for k_clock and posix_clock_operations structure

2015-04-19 Thread Baolin Wang
/itimerspec64 type. Signed-off-by: Baolin Wang --- drivers/ptp/ptp_clock.c | 26 -- include/linux/posix-clock.h | 10 +- kernel/time/posix-clock.c | 20 ++-- 3 files changed, 23 insertions(+), 33 deletions(-) diff --git a/drivers/ptp

[PATCH 09/11] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-04-19 Thread Baolin Wang
for 2038 issue. The cputime_to_timespec/timespec_to_cputime functions are moved to include/linux/cputime.h file for removing conveniently. Signed-off-by: Baolin Wang --- arch/powerpc/include/asm/cputime.h|6 +++--- arch/s390/include/asm/cputime.h |8 include/asm

[PATCH 10/11] time/posix-cpu-timers:Convert to the 64bit methods for k_clock structure

2015-04-19 Thread Baolin Wang
This patch changes to the new methods of k_clock structure with timespec64 type, converts the timespec/itimerspec type to timespec64/itimerspec64 type for the callback function in posix-cpu-timers.c file. Signed-off-by: Baolin Wang --- kernel/time/posix-cpu-timers.c | 83

[PATCH 11/11] k_clock:Remove the 32bit methods with timespec type

2015-04-19 Thread Baolin Wang
All of the k_clock users have been converted to the new methods. This patch removes the older methods with timepsec/itimerspec type. As a result, the k_clock structure is ready for the year 2038. Signed-off-by: Baolin Wang --- include/linux/posix-timers.h |9 -- kernel/time/posix

Re: [PATCH 11/11] k_clock:Remove the 32bit methods with timespec type

2015-04-20 Thread Baolin Wang
On 20 April 2015 at 16:42, Richard Cochran wrote: > On Mon, Apr 20, 2015 at 01:57:39PM +0800, Baolin Wang wrote: > > > @@ -911,18 +907,14 @@ retry: > > return -EINVAL; > > > > kc = clockid_to_kclock(timr->it_clock); > > - if (WAR

Re: [PATCH 01/11] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit

2015-04-20 Thread Baolin Wang
On 20 April 2015 at 17:49, Sergei Shtylyov < sergei.shtyl...@cogentembedded.com> wrote: > Hello. > > On 4/20/2015 8:57 AM, Baolin Wang wrote: > > This patch introduces the 'struct itimerspec64' for 64bit to replace >> itimerspec, >>

Re: [PATCH 01/11] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit

2015-04-21 Thread Baolin Wang
On 21 April 2015 at 03:14, Thomas Gleixner wrote: > On Mon, 20 Apr 2015, Baolin Wang wrote: > > This patch introduces the 'struct itimerspec64' for 64bit to replace > itimerspec, > > and also introduces the conversion methods: itimerspec64_to_itimerspec() > and

Re: [PATCH 05/11] time/posix-timers:Convert to the 64bit methods for k_clock callback functions

2015-04-21 Thread Baolin Wang
On 21 April 2015 at 04:48, Thomas Gleixner wrote: > On Mon, 20 Apr 2015, Baolin Wang wrote: > > /* Set clock_realtime */ > > static int posix_clock_realtime_set(const clockid_t which_clock, > > - cons

Re: [Y2038] [PATCH 05/11] time/posix-timers:Convert to the 64bit methods for k_clock callback functions

2015-04-21 Thread Baolin Wang
On 21 April 2015 at 16:45, Arnd Bergmann wrote: > On Tuesday 21 April 2015 16:36:13 Baolin Wang wrote: > > On 21 April 2015 at 04:48, Thomas Gleixner wrote: > > > > > On Mon, 20 Apr 2015, Baolin Wang wrote: > > > > /* Set clock_realtime */ > > >

[PATCH v2 00/15] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-04-30 Thread Baolin Wang
methods in cputime_nsecs.h file. -Modify some patch logs. Baolin Wang (15): linux/time64.h:Introduce the 'struct itimerspec64' for 64bit timekeeping:Introduce the current_kernel_time64() function with timespec64 type time/hrtimer:Introduce hrtimer_get_res64() with times

[PATCH v2 13/15] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-04-30 Thread Baolin Wang
for 2038 issue. The cputime_to_timespec/timespec_to_cputime functions are moved to include/linux/cputime.h file for removing conveniently. Signed-off-by: Baolin Wang --- arch/powerpc/include/asm/cputime.h|6 +++--- arch/s390/include/asm/cputime.h |8 include/asm

[PATCH v3 00/22] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-05-11 Thread Baolin Wang
small some patches. *** BLURB HERE *** Baolin Wang (22): linux/time64.h:Introduce the 'struct itimerspec64' for 64bit timekeeping:Introduce the current_kernel_time64() function with timespec64 type time/hrtimer:Introduce hrtimer_get_res64() with timespec64 type for getting

[PATCH v3 00/22] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-05-11 Thread Baolin Wang
small some patches. Baolin Wang (22): linux/time64.h:Introduce the 'struct itimerspec64' for 64bit timekeeping:Introduce the current_kernel_time64() function with timespec64 type time/hrtimer:Introduce hrtimer_get_res64() with timespec64 type for getting the timer resoluti

[PATCH v3 20/22] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-05-11 Thread Baolin Wang
for 2038 issue. The cputime_to_timespec/timespec_to_cputime functions are moved to include/linux/cputime.h file for removing conveniently. Signed-off-by: Baolin Wang --- arch/powerpc/include/asm/cputime.h|6 +++--- arch/s390/include/asm/cputime.h |8 include/asm

Re: [PATCH v3 00/22] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-05-12 Thread Baolin Wang
On 12 May 2015 at 17:39, Arnd Bergmann wrote: > On Monday 11 May 2015 19:08:38 Baolin Wang wrote: > > This patch series changes the 32-bit time type (timespec/itimerspec) to > the 64-bit one > > (timespec64/itimerspec64), since 32-bit time types will break in the > year 203

[PATCH v4 00/25] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-06-01 Thread Baolin Wang
type for posix_clock_operations and k_clock structure. Baolin Wang (25): time:Introduce struct itimerspec64 timekeeping:Introduce the current_kernel_time64() hrtimer:Introduce hrtimer_get_res64() security: Introduce security_settime64() time:Introduce the do_sys_settimeofday64() posix

[PATCH v4 23/25] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-06-01 Thread Baolin Wang
for 2038 issue. The cputime_to_timespec/timespec_to_cputime functions are moved to include/linux/cputime.h file for removing conveniently. Signed-off-by: Baolin Wang --- arch/powerpc/include/asm/cputime.h|6 +++--- arch/s390/include/asm/cputime.h |8 include/asm-generic

Re: [PATCH v4 00/25] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-06-02 Thread Baolin Wang
On 3 June 2015 at 03:20, Thomas Gleixner wrote: > On Mon, 1 Jun 2015, Baolin Wang wrote: > > > This patch series changes the 32-bit time types (timespec/itimerspec) to > > the 64-bit types (timespec64/itimerspec64), since 32-bit time types will > > break in the year 20

[PATCH v5 00/24] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-06-12 Thread Baolin Wang
. Changes since V1: - Split some patch into small patch. - Add some default function for new 64bit methods for syscall function. - Move do_sys_settimeofday() function to head file. - Modify the EXPORT_SYMPOL issue. - Add new 64bit methods in cputime_nsecs.h file. --- Baolin Wang (24): time: Introduce

[PATCH v5 22/24] cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()

2015-06-12 Thread Baolin Wang
/powerpc architecture. The cputime_to_timespec() and timespec_to_cputime() functions are moved to include/linux/cputime.h file as 'static inline' for removing conveniently in future. Signed-off-by: Baolin Wang --- arch/powerpc/include/asm/cputime.h|6 +++--- arch/s390/include/asm

Re: [PATCH v5 00/24] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-06-14 Thread Baolin Wang
On 12 June 2015 at 21:16, Thomas Gleixner wrote: > On Fri, 12 Jun 2015, Baolin Wang wrote: > > Sigh. Again threading of the series failed. Some patches are, the > whole series is not. Can you please get your tools straight? > > You neither managed to cc me on the security patch.

[PATCH 0/6] Introduce 64bit accessors and structures required to address y2038 issues in the posix_clock subsystem

2015-07-14 Thread Baolin Wang
nding the first few patches of the patch series, and left the other patches for later. And if you are interested in the whole patch series, see: https://git.linaro.org/people/baolin.wang/upstream_0627.git Thoughts and feedback would be appreciated. Baolin Wang (6): time: Introduce struct itimers

[PATCH 6/6] cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()

2015-07-14 Thread Baolin Wang
specific implementations in arch/s390 and arch/powerpc. Signed-off-by: Baolin Wang --- arch/powerpc/include/asm/cputime.h|6 +++--- arch/s390/include/asm/cputime.h |8 include/asm-generic/cputime_jiffies.h | 10 +- include/asm-generic/cputime_nsecs.h |6

Re: [PATCH 6/6] cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()

2015-07-15 Thread Baolin Wang
On 15 July 2015 at 18:31, Thomas Gleixner wrote: > On Wed, 15 Jul 2015, Baolin Wang wrote: > >> The cputime_to_timespec() and timespec_to_cputime() functions are >> not year 2038 safe on 32bit systems due to that the struct timepsec >> will overflow in 2038 year. >

Re: [PATCH 6/6] cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()

2015-07-15 Thread Baolin Wang
On 15 July 2015 at 19:55, Thomas Gleixner wrote: > On Wed, 15 Jul 2015, Baolin Wang wrote: > >> On 15 July 2015 at 18:31, Thomas Gleixner wrote: >> > On Wed, 15 Jul 2015, Baolin Wang wrote: >> > >> >> The cputime_to_timespec() and timespec_to_cputime()

Re: [PATCH 6/6] cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()

2015-07-17 Thread Baolin Wang
On 16 July 2015 at 18:43, Thomas Gleixner wrote: > On Thu, 16 Jul 2015, Baolin Wang wrote: >> On 15 July 2015 at 19:55, Thomas Gleixner wrote: >> > On Wed, 15 Jul 2015, Baolin Wang wrote: >> > >> >> On 15 July 2015 at 18:31, Thomas Gleixner wrote: >>

Re: [PATCH v3] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-21 Thread Baolin Wang
ke Kravetz LGTM, and works well on my machine. So feel free to add: Reviewed-by: Baolin Wang Tested-by: Baolin Wang

[PATCH 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-04-29 Thread Baolin Wang
to help to nuke a hugetlb page table. Signed-off-by: Baolin Wang --- arch/arm64/include/asm/hugetlb.h | 4 ++-- arch/arm64/mm/hugetlbpage.c| 12 +--- arch/ia64/include/asm/hugetlb.h| 4 ++-- arch/mips/include/asm/hugetlb.h| 9 ++--- arch/parisc/include/asm

[PATCH 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-04-29 Thread Baolin Wang
) and set_huge_swap_pte_at() when migrating a hugetlb page, which already considered the CONT-PTE or CONT-PMD size hugetlb. Signed-off-by: Baolin Wang --- mm/rmap.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 6fdd198..7c

[PATCH 0/3] Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating

2022-04-29 Thread Baolin Wang
will change to use hugetlb related APIs to fix this issue, please find details in each patch. Thanks. Baolin Wang (3): mm: change huge_ptep_clear_flush() to return the original pte mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration mm: rmap: Fix CONT-PTE/PMD size hugetlb issue

[PATCH 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-04-29 Thread Baolin Wang
used set_huge_swap_pte_at() to set a poisoned swap entry for a poisoned hugetlb page. Signed-off-by: Baolin Wang --- mm/rmap.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 7cf2408..1e168d7 100644 --- a/mm/rmap.c

Re: [PATCH 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-04-29 Thread Baolin Wang
On 4/30/2022 4:02 AM, Gerald Schaefer wrote: On Fri, 29 Apr 2022 16:14:43 +0800 Baolin Wang wrote: On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb: 2M and 1G, but also CONT-PTE/PMD size: 64K and 32M if a

Re: [PATCH 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-02 Thread Baolin Wang
On 5/2/2022 10:02 PM, Gerald Schaefer wrote: On Sat, 30 Apr 2022 11:22:33 +0800 Baolin Wang wrote: On 4/30/2022 4:02 AM, Gerald Schaefer wrote: On Fri, 29 Apr 2022 16:14:43 +0800 Baolin Wang wrote: On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which

Re: [PATCH 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-03 Thread Baolin Wang
On 5/3/2022 6:03 PM, Gerald Schaefer wrote: On Tue, 3 May 2022 10:19:46 +0800 Baolin Wang wrote: On 5/2/2022 10:02 PM, Gerald Schaefer wrote: On Sat, 30 Apr 2022 11:22:33 +0800 Baolin Wang wrote: On 4/30/2022 4:02 AM, Gerald Schaefer wrote: On Fri, 29 Apr 2022 16:14:43 +0800

Re: [PATCH 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-05 Thread Baolin Wang
On 5/6/2022 7:15 AM, Mike Kravetz wrote: On 4/29/22 01:14, Baolin Wang wrote: It is incorrect to use ptep_clear_flush() to nuke a hugetlb page table when unmapping or migrating a hugetlb page, and will change to use huge_ptep_clear_flush() instead in the following patches. So this is a

Re: [PATCH 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-05 Thread Baolin Wang
On 5/6/2022 7:53 AM, Mike Kravetz wrote: On 4/29/22 01:14, Baolin Wang wrote: On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb: 2M and 1G, but also CONT-PTE/PMD size: 64K and 32M if a 4K page size specified

Re: [PATCH 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-06 Thread Baolin Wang
On 5/7/2022 2:55 AM, Mike Kravetz wrote: On 4/29/22 01:14, Baolin Wang wrote: On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb: 2M and 1G, but also CONT-PTE/PMD size: 64K and 32M if a 4K page size specified

Re: [PATCH 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-06 Thread Baolin Wang
On 5/7/2022 1:56 AM, Mike Kravetz wrote: On 5/5/22 20:39, Baolin Wang wrote: On 5/6/2022 7:53 AM, Mike Kravetz wrote: On 4/29/22 01:14, Baolin Wang wrote: On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb

Re: [PATCH 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-08 Thread Baolin Wang
On 5/7/2022 10:33 AM, Baolin Wang wrote: On 5/7/2022 1:56 AM, Mike Kravetz wrote: On 5/5/22 20:39, Baolin Wang wrote: On 5/6/2022 7:53 AM, Mike Kravetz wrote: On 4/29/22 01:14, Baolin Wang wrote: On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means

[PATCH v2 0/3] Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating

2022-05-08 Thread Baolin Wang
plict void casting for huge_ptep_clear_flush() in hugetlb.c. Baolin Wang (3): mm: change huge_ptep_clear_flush() to return the original pte mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping arch/arm64/include/asm/huge

[PATCH v2 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-08 Thread Baolin Wang
to help to nuke a hugetlb page table. Signed-off-by: Baolin Wang Acked-by: Mike Kravetz --- arch/arm64/include/asm/hugetlb.h | 4 ++-- arch/arm64/mm/hugetlbpage.c| 12 +--- arch/ia64/include/asm/hugetlb.h| 4 ++-- arch/mips/include/asm/hugetlb.h| 9 ++--- arch

[PATCH v2 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-08 Thread Baolin Wang
hugetlb. We've already used set_huge_swap_pte_at() to set a poisoned swap entry for a poisoned hugetlb page. Meanwhile adding a VM_BUG_ON() to make sure the passed hugetlb page is poisoned in try_to_unmap(). Signed-off-by: Baolin Wang --- mm/rmap.c | 39 ++- 1

[PATCH v2 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-08 Thread Baolin Wang
) and set_huge_swap_pte_at() when migrating a hugetlb page, which already considered the CONT-PTE or CONT-PMD size hugetlb. Signed-off-by: Baolin Wang --- mm/rmap.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 6fdd198..7c

Re: [PATCH v2 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-08 Thread Baolin Wang
On 5/8/2022 7:09 PM, Muchun Song wrote: On Sun, May 08, 2022 at 05:36:39PM +0800, Baolin Wang wrote: It is incorrect to use ptep_clear_flush() to nuke a hugetlb page table when unmapping or migrating a hugetlb page, and will change to use huge_ptep_clear_flush() instead in the following

Re: [PATCH v2 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-08 Thread Baolin Wang
applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Baolin-Wang/Fix-CONT-PTE-PMD-size-hugetlb-issue-when-unmapping-or

Re: [PATCH v2 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-09 Thread Baolin Wang
On 5/9/2022 1:46 PM, Christophe Leroy wrote: Le 08/05/2022 à 15:09, Baolin Wang a écrit : On 5/8/2022 7:09 PM, Muchun Song wrote: On Sun, May 08, 2022 at 05:36:39PM +0800, Baolin Wang wrote: It is incorrect to use ptep_clear_flush() to nuke a hugetlb page table when unmapping or

Re: [PATCH 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-09 Thread Baolin Wang
On 5/10/2022 12:41 AM, Peter Xu wrote: On Fri, May 06, 2022 at 12:07:13PM -0700, Mike Kravetz wrote: On 5/3/22 03:03, Gerald Schaefer wrote: On Tue, 3 May 2022 10:19:46 +0800 Baolin Wang wrote: On 5/2/2022 10:02 PM, Gerald Schaefer wrote: [...] Please see previous code, we'll us

Re: [PATCH v2 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-09 Thread Baolin Wang
On 5/10/2022 4:02 AM, Mike Kravetz wrote: On 5/9/22 01:46, Baolin Wang wrote: On 5/9/2022 1:46 PM, Christophe Leroy wrote: Le 08/05/2022 à 15:09, Baolin Wang a écrit : On 5/8/2022 7:09 PM, Muchun Song wrote: On Sun, May 08, 2022 at 05:36:39PM +0800, Baolin Wang wrote: It is

[PATCH v3 0/3] Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating

2022-05-09 Thread Baolin Wang
dding dummy functions for !CONFIG_HUGETLB_PAGE. Changes from v1: - Add acked tag from Mike. - Update some commit message. - Add VM_BUG_ON in try_to_unmap() for hugetlb case. - Add an explict void casting for huge_ptep_clear_flush() in hugetlb.c. Baolin Wang (3): mm: change huge_ptep_clear_flush

[PATCH v3 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-09 Thread Baolin Wang
to help to nuke a hugetlb page table. Signed-off-by: Baolin Wang Acked-by: Mike Kravetz Reviewed-by: Muchun Song --- arch/arm64/include/asm/hugetlb.h | 4 ++-- arch/arm64/mm/hugetlbpage.c| 12 +--- arch/ia64/include/asm/hugetlb.h| 4 ++-- arch/mips/include/asm/hugetlb.h

[PATCH v3 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-09 Thread Baolin Wang
) and set_huge_swap_pte_at() when migrating a hugetlb page, which already considered the CONT-PTE or CONT-PMD size hugetlb. Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 11 +++ mm/rmap.c

[PATCH v3 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-09 Thread Baolin Wang
hugetlb. We've already used set_huge_swap_pte_at() to set a poisoned swap entry for a poisoned hugetlb page. Meanwhile adding a VM_BUG_ON() to make sure the passed hugetlb page is poisoned in try_to_unmap(). Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz --- mm/r

Re: [PATCH v3 0/3] Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating

2022-05-09 Thread Baolin Wang
On 5/10/2022 12:04 PM, Andrew Morton wrote: On Tue, 10 May 2022 11:45:57 +0800 Baolin Wang wrote: Hi, Now migrating a hugetlb page or unmapping a poisoned hugetlb page, we'll use ptep_clear_flush() and set_pte_at() to nuke the page table entry and remap it, and this is incorrect for

Re: [PATCH v3 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-10 Thread Baolin Wang
On 5/11/2022 7:28 AM, Andrew Morton wrote: On Tue, 10 May 2022 16:17:39 -0700 Andrew Morton wrote: + +static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, + unsigned long addr, pte_t *ptep) +{ + return ptep_get(ptep); +} + +sta

[PATCH v4 3/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping

2022-05-11 Thread Baolin Wang
hugetlb. We've already used set_huge_swap_pte_at() to set a poisoned swap entry for a poisoned hugetlb page. Meanwhile adding a VM_BUG_ON() to make sure the passed hugetlb page is poisoned in try_to_unmap(). Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz --- mm/r

[PATCH v4 1/3] mm: change huge_ptep_clear_flush() to return the original pte

2022-05-11 Thread Baolin Wang
to help to nuke a hugetlb page table. Signed-off-by: Baolin Wang Acked-by: Mike Kravetz Reviewed-by: Muchun Song --- arch/arm64/include/asm/hugetlb.h | 4 ++-- arch/arm64/mm/hugetlbpage.c| 12 +--- arch/ia64/include/asm/hugetlb.h| 5 +++-- arch/mips/include/asm/hugetlb.h

[PATCH v4 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-11 Thread Baolin Wang
) and set_huge_swap_pte_at() when migrating a hugetlb page, which already considered the CONT-PTE or CONT-PMD size hugetlb. Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 11 +++ mm/rmap.c

[PATCH v4 0/3] Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating

2022-05-11 Thread Baolin Wang
tlb.c. Baolin Wang (3): mm: change huge_ptep_clear_flush() to return the original pte mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when unmapping arch/arm64/include/asm/hugetlb.h | 4 +-- arch/arm64/mm/hugetlbpage.c

Re: [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings

2024-06-25 Thread Baolin Wang
On 2024/6/25 11:16, Kefeng Wang wrote: On 2024/6/24 23:56, Ryan Roberts wrote: + Baolin Wang and Yin Fengwei, who maybe able to help with this. Hi Kefeng, Thanks for the report! On 24/06/2024 15:30, Kefeng Wang wrote: Hi Ryan, A big regression on page-fault3("Separate file s

Re: [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings

2024-06-25 Thread Baolin Wang
On 2024/6/25 19:40, Ryan Roberts wrote: On 25/06/2024 08:23, Baolin Wang wrote: On 2024/6/25 11:16, Kefeng Wang wrote: On 2024/6/24 23:56, Ryan Roberts wrote: + Baolin Wang and Yin Fengwei, who maybe able to help with this. Hi Kefeng, Thanks for the report! On 24/06/2024 15:30

Re: [PATCH 1/4] hugetlb: skip to end of PT page mapping when pte not present

2022-06-17 Thread Baolin Wang
On 6/18/2022 1:17 AM, Mike Kravetz wrote: On 06/17/22 10:15, Peter Xu wrote: Hi, Mike, On Thu, Jun 16, 2022 at 02:05:15PM -0700, Mike Kravetz wrote: @@ -6877,6 +6896,39 @@ pte_t *huge_pte_offset(struct mm_struct *mm, return (pte_t *)pmd; } +/* + * Return a mask that can be use