Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers
On 08/26/2019 06:43 PM, Matthew Wilcox wrote: > On Mon, Aug 26, 2019 at 08:07:13AM +0530, Anshuman Khandual wrote: >> On 08/09/2019 07:22 PM, Matthew Wilcox wrote: >>> On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: >> Should alloc_gigantic_page() be made available as an interface for >> general >> use in the kernel. The test module here uses very similar implementation >> from >> HugeTLB to allocate a PUD aligned memory block. Similar for mm_alloc() >> which >> needs to be exported through a header. > > Why are you allocating memory at all instead of just using some > known-to-exist PFNs like I suggested? We needed PFN to be PUD aligned for pfn_pud() and PMD aligned for mk_pmd(). Now walking the kernel page table for a known symbol like kernel_init() >>> >>> I didn't say to walk the kernel page table. I said to call virt_to_pfn() >>> for a known symbol like kernel_init(). >>> as you had suggested earlier we might encounter page table page entries at PMD and PUD which might not be PMD or PUD aligned respectively. It seemed to me that alignment requirement is applicable only for mk_pmd() and pfn_pud() which create large mappings at those levels but that requirement does not exist for page table pages pointing to next level. Is not that correct ? Or I am missing something here ? >>> >>> Just clear the bottom bits off the PFN until you get a PMD or PUD aligned >>> PFN. It's really not hard. >> >> As Mark pointed out earlier that might end up being just a synthetic PFN >> which might not even exist on a given system. > > And why would that matter? > To start with the test uses struct page with mk_pte() and mk_pmd() while pfn gets used in pfn_pud() during pXX_basic_tests(). So we will not be able to derive a valid struct page from a synthetic pfn. Also if synthetic pfn is going to be used anyway then why derive it from a real kernel symbol like kernel_init(). Could not one be just made up with right alignment ? Currently the test allocates 'mm_struct' and other page table pages from real memory then why should it use synthetic pfn while creating actual page table entries ? Couple of benefits going with synthetic pfn will be.. - It simplifies the test a bit removing PUD_SIZE allocation helpers - It might enable the test to be run on systems without adequate memory In the current proposal the allocation happens during boot making it much more likely to succeed than not and when it fails, respective tests will be skipped. I am just wondering if being able to run complete set of tests on smaller systems with less memory weighs lot more in favor of going with synthetic pfn instead. ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 2/3] kbuild, arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC
Hi Vineet, On Wed, Aug 21, 2019 at 2:10 AM Masahiro Yamada wrote: > > arch/arc/Makefile overrides -O2 with -O3. This is the only user of > ARCH_CFLAGS. There is no user of ARCH_CPPFLAGS or ARCH_AFLAGS. > My plan is to remove ARCH_{CPP,A,C}FLAGS after refactoring the ARC > Makefile. > > Currently, ARC has no way to enable -Wmaybe-uninitialized because both > -O3 and -Os disable it. Enabling it will be useful for compile-testing. > This commit allows allmodconfig (, which defaults to -O2) to enable it. > > Add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y to all the defconfig files > in arch/arc/configs/ in order to keep the current config settings. > > Signed-off-by: Masahiro Yamada > --- If it is OK to apply this to my kbuild tree, can I get your ACK? If you see any problem, please let me know. Thanks. > > Makefile | 10 ++ > arch/arc/Makefile | 8 > arch/arc/configs/axs101_defconfig | 1 + > arch/arc/configs/axs103_defconfig | 1 + > arch/arc/configs/axs103_smp_defconfig | 1 + > arch/arc/configs/haps_hs_defconfig | 1 + > arch/arc/configs/haps_hs_smp_defconfig | 1 + > arch/arc/configs/hsdk_defconfig| 1 + > arch/arc/configs/nps_defconfig | 1 + > arch/arc/configs/nsim_700_defconfig| 1 + > arch/arc/configs/nsim_hs_defconfig | 1 + > arch/arc/configs/nsim_hs_smp_defconfig | 1 + > arch/arc/configs/nsimosci_defconfig| 1 + > arch/arc/configs/nsimosci_hs_defconfig | 1 + > arch/arc/configs/nsimosci_hs_smp_defconfig | 1 + > arch/arc/configs/tb10x_defconfig | 1 + > arch/arc/configs/vdk_hs38_defconfig| 1 + > arch/arc/configs/vdk_hs38_smp_defconfig| 1 + > init/Kconfig | 12 ++-- > 19 files changed, 32 insertions(+), 14 deletions(-) > > diff --git a/Makefile b/Makefile > index bc55f366677d..891e47da503f 100644 > --- a/Makefile > +++ b/Makefile > @@ -716,10 +716,12 @@ KBUILD_CFLAGS += $(call cc-disable-warning, > format-truncation) > KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) > KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) > > -ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE > -KBUILD_CFLAGS += -Os > -else > -KBUILD_CFLAGS += -O2 > +ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE > +KBUILD_CFLAGS += -O2 > +else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 > +KBUILD_CFLAGS += -O3 > +else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE > +KBUILD_CFLAGS += -Os > endif > > ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED > diff --git a/arch/arc/Makefile b/arch/arc/Makefile > index ee6d1184c2b1..f1c44cccf8d6 100644 > --- a/arch/arc/Makefile > +++ b/arch/arc/Makefile > @@ -48,14 +48,6 @@ endif > cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI) > cflags-$(CONFIG_ARC_DW2_UNWIND)+= > -fasynchronous-unwind-tables $(cfi) > > -ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE > -# Generic build system uses -O2, we want -O3 > -# Note: No need to add to cflags-y as that happens anyways > -# > -# Disable the false maybe-uninitialized warings gcc spits out at -O3 > -ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,) > -endif > - > # small data is default for elf32 tool-chain. If not usable, disable it > # This also allows repurposing GP as scratch reg to gcc reg allocator > disable_small_data := y > diff --git a/arch/arc/configs/axs101_defconfig > b/arch/arc/configs/axs101_defconfig > index e31a8ebc3ecc..0016149f9583 100644 > --- a/arch/arc/configs/axs101_defconfig > +++ b/arch/arc/configs/axs101_defconfig > @@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y > # CONFIG_UTS_NS is not set > # CONFIG_PID_NS is not set > CONFIG_BLK_DEV_INITRD=y > +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y > CONFIG_EMBEDDED=y > CONFIG_PERF_EVENTS=y > # CONFIG_VM_EVENT_COUNTERS is not set > diff --git a/arch/arc/configs/axs103_defconfig > b/arch/arc/configs/axs103_defconfig > index e0e8567f0d75..5b031582a1cf 100644 > --- a/arch/arc/configs/axs103_defconfig > +++ b/arch/arc/configs/axs103_defconfig > @@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y > # CONFIG_UTS_NS is not set > # CONFIG_PID_NS is not set > CONFIG_BLK_DEV_INITRD=y > +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y > CONFIG_EMBEDDED=y > CONFIG_PERF_EVENTS=y > # CONFIG_VM_EVENT_COUNTERS is not set > diff --git a/arch/arc/configs/axs103_smp_defconfig > b/arch/arc/configs/axs103_smp_defconfig > index fcbc952bc75b..d4eec39e0112 100644 > --- a/arch/arc/configs/axs103_smp_defconfig > +++ b/arch/arc/configs/axs103_smp_defconfig > @@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y > # CONFIG_UTS_NS is not set > # CONFIG_PID_NS is not set > CONFIG_BLK_DEV_INITRD=y > +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y > CONFIG_EMBEDDED=y > CONFIG_PERF_EVENTS=y > # CONFIG_VM_EVENT_COUNTERS is not set > diff --git a/arch/arc/configs/haps_hs_defconfig > b/arch/arc/configs/haps_hs_defconfig > index 436f2135bdc1..47ff8a97e42
Re: [PATCH] ARC: unwind: Mark expected switch fall-through
Hi, Friendly ping: Who can take this, please? Thanks -- Gustavo On 8/20/19 8:29 PM, Gustavo A. R. Silva wrote: > Mark switch cases where we are expecting to fall through. > > This patch fixes the following warnings (Building: haps_hs_defconfig arc): > > arch/arc/kernel/unwind.c: In function ‘read_pointer’: > ./include/linux/compiler.h:328:5: warning: this statement may fall through > [-Wimplicit-fallthrough=] > do {\ > ^ > ./include/linux/compiler.h:338:2: note: in expansion of macro > ‘__compiletime_assert’ > __compiletime_assert(condition, msg, prefix, suffix) > ^~~~ > ./include/linux/compiler.h:350:2: note: in expansion of macro > ‘_compiletime_assert’ > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > ^~~ > ./include/linux/build_bug.h:39:37: note: in expansion of macro > ‘compiletime_assert’ > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^~ > ./include/linux/build_bug.h:50:2: note: in expansion of macro > ‘BUILD_BUG_ON_MSG’ > BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) > ^~~~ > arch/arc/kernel/unwind.c:573:3: note: in expansion of macro ‘BUILD_BUG_ON’ >BUILD_BUG_ON(sizeof(u32) != sizeof(value)); >^~~~ > arch/arc/kernel/unwind.c:575:2: note: here > case DW_EH_PE_native: > ^~~~ > > Signed-off-by: Gustavo A. R. Silva > --- > arch/arc/kernel/unwind.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c > index 445e4d702f43..dc05a63516f5 100644 > --- a/arch/arc/kernel/unwind.c > +++ b/arch/arc/kernel/unwind.c > @@ -572,6 +572,7 @@ static unsigned long read_pointer(const u8 **pLoc, const > void *end, > #else > BUILD_BUG_ON(sizeof(u32) != sizeof(value)); > #endif > + /* Fall through */ > case DW_EH_PE_native: > if (end < (const void *)(ptr.pul + 1)) > return 0; > ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc