1. 06 10月, 2018 1 次提交
  2. 28 8月, 2018 1 次提交
  3. 10 7月, 2018 1 次提交
    • P
      ARC: Improve cmpxchg syscall implementation · e8708786
      Peter Zijlstra 提交于
      This is used in configs lacking hardware atomics to emulate atomic r-m-w
      for user space, implemented by disabling preemption in kernel.
      
      However there are issues in current implementation:
      
      1. Process not terminated if invalid user pointer passed:
         i.e. __get_user() failed.
      
      2. The reason for this patch was __put_user() failure not being handled
         either, specifically for the COW break scenario.
         The zero page is initially wired up and read from __get_user()
         succeeds. A subsequent write by __put_user() induces a
         Protection Violation, but COW can't finish as Linux page fault
         handler is disabled due to preempt disable.
         And what's worse is we silently return the stale value to user space.
         Fix this specific case by re-enabling preemption and explicitly
         fixing up the fault and retrying the whole sequence over.
      
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: linux-arch@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: rewrote the changelog]
      e8708786
  4. 21 6月, 2018 4 次提交
    • M
      bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe · cce188bd
      Masami Hiramatsu 提交于
      Clear current_kprobe and enable preemption in kprobe
      even if pre_handler returns !0.
      
      This simplifies function override using kprobes.
      
      Jprobe used to require to keep the preemption disabled and
      keep current_kprobe until it returned to original function
      entry. For this reason kprobe_int3_handler() and similar
      arch dependent kprobe handers checks pre_handler result
      and exit without enabling preemption if the result is !0.
      
      After removing the jprobe, Kprobes does not need to
      keep preempt disabled even if user handler returns !0
      anymore.
      
      But since the function override handler in error-inject
      and bpf is also returns !0 if it overrides a function,
      to balancing the preempt count, it enables preemption
      and reset current kprobe by itself.
      
      That is a bad design that is very buggy. This fixes
      such unbalanced preempt-count and current_kprobes setting
      in kprobes, bpf and error-inject.
      
      Note: for powerpc and x86, this removes all preempt_disable
      from kprobe_ftrace_handler because ftrace callbacks are
      called under preempt disabled.
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Josef Bacik <jbacik@fb.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: sparclinux@vger.kernel.org
      Link: https://lore.kernel.org/lkml/152942494574.15209.12323837825873032258.stgit@devboxSigned-off-by: NIngo Molnar <mingo@kernel.org>
      cce188bd
    • M
      ARC/kprobes: Don't call the ->break_handler() in ARC kprobes code · 5ed4b0c5
      Masami Hiramatsu 提交于
      Don't call the ->break_handler() from the ARC kprobes code,
      because it was only used by jprobes which got removed.
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Link: https://lore.kernel.org/lkml/152942468446.15209.13773902741600803798.stgit@devboxSigned-off-by: NIngo Molnar <mingo@kernel.org>
      5ed4b0c5
    • M
      ARC/kprobes: Remove jprobe implementation · e00f1993
      Masami Hiramatsu 提交于
      Remove arch dependent setjump/longjump functions
      and unused fields in kprobe_ctlblk for jprobes
      from arch/arc.
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Link: https://lore.kernel.org/lkml/152942436460.15209.3038881268172249579.stgit@devboxSigned-off-by: NIngo Molnar <mingo@kernel.org>
      e00f1993
    • A
      ARC: Enable machine_desc->init_per_cpu for !CONFIG_SMP · 2f24ef74
      Alexey Brodkin 提交于
      machine_desc->init_per_cpu() hook is supposed to be per cpu
      initialization and would seem to apply  equally to UP and/or SMP.
      Infact the comment in header file seems to suggest it works for
      UP too, which was not the case and this patch.
      
      This enables !CONFIG_SMP build for platforms such as hsdk.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: trimmeed changelog]
      2f24ef74
  5. 01 3月, 2018 4 次提交
    • E
      ARC: setup cpu possible mask according to possible-cpus dts property · a29a2527
      Eugeniy Paltsev 提交于
      As we have option in u-boot to set CPU mask for running linux,
      we want to pass information to kernel about CPU cores should
      be brought up. So we patch kernel dtb in u-boot to set
      possible-cpus property.
      
      This also allows us to have correctly setuped MCIP debug mask.
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      a29a2527
    • E
      ARC: mcip: update MCIP debug mask when the new cpu came online · f3205de9
      Eugeniy Paltsev 提交于
      As of today we use hardcoded MCIP debug mask, so if we launch
      kernel via debugger and kick fever cores than HW has all cpus
      hang at the momemt of setup MCIP debug mask.
      
      So update MCIP debug mask when the new cpu came online, instead of
      use hardcoded MCIP debug mask.
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      f3205de9
    • E
      ARC: mcip: halt GFRC counter when ARC cores halt · 07423d00
      Eugeniy Paltsev 提交于
      In SMP systems, GFRC is used for clocksource. However by default the
      counter keeps running even when core is halted (say when debugging via a
      JTAG debugger). This confuses Linux timekeeping and triggers flase RCU stall
      splat such as below:
      
      | [ARCLinux]# while true; do ./shm_open_23-1.run-test ; done
      | Running with 1000 processes for 1000 objects
      | hrtimer: interrupt took 485060 ns
      |
      | create_cnt: 1000
      | Running with 1000 processes for 1000 objects
      | [ARCLinux]# INFO: rcu_preempt self-detected stall on CPU
      |       2-...: (1 GPs behind) idle=a01/1/0 softirq=135770/135773 fqs=0
      | INFO: rcu_preempt detected stalls on CPUs/tasks:
      | 	0-...: (1 GPs behind) idle=71e/0/0 softirq=135264/135264 fqs=0
      |	2-...: (1 GPs behind) idle=a01/1/0 softirq=135770/135773 fqs=0
      |	3-...: (1 GPs behind) idle=4e0/0/0 softirq=134304/134304 fqs=0
      |	(detected by 1, t=13648 jiffies, g=31493, c=31492, q=1)
      
      Starting from ARC HS v3.0 it's possible to tie GFRC to state of up-to 4
      ARC cores with help of GFRC's CORE register where we set a mask for
      cores which state we need to rely on.
      
      We update cpu mask every time new cpu came online instead of using
      hardcoded one or using mask generated from "possible_cpus" as we
      want it set correctly even if we run kernel on HW which has fewer cores
      than expected (or we launch kernel via debugger and kick fever cores
      than HW has)
      
      Note that GFRC halts when all cores have halted and thus relies on
      programming of Inter-Core-dEbug register to halt all cores when one
      halts.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: rewrote changelog]
      07423d00
    • V
      ARCv2: boot log: fix HS48 release number · 701eda01
      Vineet Gupta 提交于
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      701eda01
  6. 23 2月, 2018 1 次提交
  7. 22 2月, 2018 1 次提交
    • I
      treewide/trivial: Remove ';;$' typo noise · ed7158ba
      Ingo Molnar 提交于
      On lkml suggestions were made to split up such trivial typo fixes into per subsystem
      patches:
      
        --- a/arch/x86/boot/compressed/eboot.c
        +++ b/arch/x86/boot/compressed/eboot.c
        @@ -439,7 +439,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height)
                struct efi_uga_draw_protocol *uga = NULL, *first_uga;
                efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
                unsigned long nr_ugas;
        -       u32 *handles = (u32 *)uga_handle;;
        +       u32 *handles = (u32 *)uga_handle;
                efi_status_t status = EFI_INVALID_PARAMETER;
                int i;
      
      This patch is the result of the following script:
      
        $ sed -i 's/;;$/;/g' $(git grep -E ';;$'  | grep "\.[ch]:"  | grep -vwE 'for|ia64' | cut -d: -f1 | sort | uniq)
      
      ... followed by manual review to make sure it's all good.
      
      Splitting this up is just crazy talk, let's get over with this and just do it.
      Reported-by: NPavel Machek <pavel@ucw.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ed7158ba
  8. 24 1月, 2018 2 次提交
  9. 23 1月, 2018 1 次提交
  10. 03 1月, 2018 1 次提交
  11. 21 12月, 2017 2 次提交
  12. 29 11月, 2017 1 次提交
  13. 22 11月, 2017 2 次提交
  14. 14 11月, 2017 1 次提交
    • V
      ARCv2: boot log: updates for HS48: dual-issue, ECC, Loop Buffer · f3156851
      Vineet Gupta 提交于
      Print the hardware support for ECC, Loop Buffer as well as the runtime
      enabled status
      
      Note that unlike the existing boot printing, this one is not read from
      pre-decoded hardware capabilty info cached in cpuinfo[] struct.
      Instead we read the AUX regs on the spot and print it, without botherign
      to save anywhere.
      
      There is no point in saving static hardware capabilites in memory when
      its use is very sporadic and non-performance critical, mainly for
      /proc/cpuinfo. This gets worse in SMP, given it is per-cpu, and pretty
      much exactly same across all cpus. So only info needed at runtime
      (e.g. TLB geometry) needs to be cached in cpuinfo[]. So going fwd
      we will start converting code to this paradigm.
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      f3156851
  15. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  16. 25 10月, 2017 1 次提交
    • M
      locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns... · 6aa7de05
      Mark Rutland 提交于
      locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
      
      Please do not apply this to mainline directly, instead please re-run the
      coccinelle script shown below and apply its output.
      
      For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
      preference to ACCESS_ONCE(), and new code is expected to use one of the
      former. So far, there's been no reason to change most existing uses of
      ACCESS_ONCE(), as these aren't harmful, and changing them results in
      churn.
      
      However, for some features, the read/write distinction is critical to
      correct operation. To distinguish these cases, separate read/write
      accessors must be used. This patch migrates (most) remaining
      ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
      coccinelle script:
      
      ----
      // Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
      // WRITE_ONCE()
      
      // $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch
      
      virtual patch
      
      @ depends on patch @
      expression E1, E2;
      @@
      
      - ACCESS_ONCE(E1) = E2
      + WRITE_ONCE(E1, E2)
      
      @ depends on patch @
      expression E;
      @@
      
      - ACCESS_ONCE(E)
      + READ_ONCE(E)
      ----
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: davem@davemloft.net
      Cc: linux-arch@vger.kernel.org
      Cc: mpe@ellerman.id.au
      Cc: shuah@kernel.org
      Cc: snitzer@redhat.com
      Cc: thor.thayer@linux.intel.com
      Cc: tj@kernel.org
      Cc: viro@zeniv.linux.org.uk
      Cc: will.deacon@arm.com
      Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      6aa7de05
  17. 12 10月, 2017 1 次提交
    • V
      ARC: unbork module link errors with !CONFIG_ARC_HAS_LLSC · fdbed196
      Vineet Gupta 提交于
      |  SYSMAP  System.map
      |  Building modules, stage 2.
      |  MODPOST 18 modules
      |ERROR: "smp_atomic_ops_lock" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
      |ERROR: "smp_bitops_lock" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
      |ERROR: "smp_atomic_ops_lock" [drivers/gpu/drm/drm.ko] undefined!
      | ERROR: "smp_bitops_lock" [drivers/gpu/drm/drm.ko] undefined!
      |../scripts/Makefile.modpost:91: recipe for target '__modpost' failed
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      fdbed196
  18. 04 10月, 2017 2 次提交
  19. 14 9月, 2017 1 次提交
    • M
      mm: treewide: remove GFP_TEMPORARY allocation flag · 0ee931c4
      Michal Hocko 提交于
      GFP_TEMPORARY was introduced by commit e12ba74d ("Group short-lived
      and reclaimable kernel allocations") along with __GFP_RECLAIMABLE.  It's
      primary motivation was to allow users to tell that an allocation is
      short lived and so the allocator can try to place such allocations close
      together and prevent long term fragmentation.  As much as this sounds
      like a reasonable semantic it becomes much less clear when to use the
      highlevel GFP_TEMPORARY allocation flag.  How long is temporary? Can the
      context holding that memory sleep? Can it take locks? It seems there is
      no good answer for those questions.
      
      The current implementation of GFP_TEMPORARY is basically GFP_KERNEL |
      __GFP_RECLAIMABLE which in itself is tricky because basically none of
      the existing caller provide a way to reclaim the allocated memory.  So
      this is rather misleading and hard to evaluate for any benefits.
      
      I have checked some random users and none of them has added the flag
      with a specific justification.  I suspect most of them just copied from
      other existing users and others just thought it might be a good idea to
      use without any measuring.  This suggests that GFP_TEMPORARY just
      motivates for cargo cult usage without any reasoning.
      
      I believe that our gfp flags are quite complex already and especially
      those with highlevel semantic should be clearly defined to prevent from
      confusion and abuse.  Therefore I propose dropping GFP_TEMPORARY and
      replace all existing users to simply use GFP_KERNEL.  Please note that
      SLAB users with shrinkers will still get __GFP_RECLAIMABLE heuristic and
      so they will be placed properly for memory fragmentation prevention.
      
      I can see reasons we might want some gfp flag to reflect shorterm
      allocations but I propose starting from a clear semantic definition and
      only then add users with proper justification.
      
      This was been brought up before LSF this year by Matthew [1] and it
      turned out that GFP_TEMPORARY really doesn't have a clear semantic.  It
      seems to be a heuristic without any measured advantage for most (if not
      all) its current users.  The follow up discussion has revealed that
      opinions on what might be temporary allocation differ a lot between
      developers.  So rather than trying to tweak existing users into a
      semantic which they haven't expected I propose to simply remove the flag
      and start from scratch if we really need a semantic for short term
      allocations.
      
      [1] http://lkml.kernel.org/r/20170118054945.GD18349@bombadil.infradead.org
      
      [akpm@linux-foundation.org: fix typo]
      [akpm@linux-foundation.org: coding-style fixes]
      [sfr@canb.auug.org.au: drm/i915: fix up]
        Link: http://lkml.kernel.org/r/20170816144703.378d4f4d@canb.auug.org.au
      Link: http://lkml.kernel.org/r/20170728091904.14627-1-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0ee931c4
  20. 02 9月, 2017 3 次提交
    • J
      ARC: Re-enable MMU upon Machine Check exception · 1ee55a8f
      Jose Abreu 提交于
      I recently came upon a scenario where I would get a double fault
      machine check exception tiriggered by a kernel module.
      However the ensuing crash stacktrace (ksym lookup) was not working
      correctly.
      
      Turns out that machine check auto-disables MMU while modules are allocated
      in kernel vaddr spapce.
      
      This patch re-enables the MMU before start printing the stacktrace
      making stacktracing of modules work upon a fatal exception.
      
      Cc: stable@kernel.org
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Reviewed-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: moved code into low level handler to avoid in 2 places]
      1ee55a8f
    • J
      ARC: Show fault information passed to show_kernel_fault_diag() · aa7e3a5e
      Jose Abreu 提交于
      Currently we pass a string argument to show_kernel_fault_diag() which
      describes the reason for the fault. This is not being used so just
      add a pr_info() which outputs the fault information.
      
      With this change we get from:
      
      |
      | Path: /bin/busybox
      | CPU: 0 PID: 92 Comm: modprobe Not tainted 4.12.0-rc6 #30
      | task: 9a254780 task.stack: 9a212000
      |
      | [ECR   ]: 0x00200400 => Other Fatal Err
      |
      
      to:
      
      |
      | Unhandled Machine Check Exception
      | Path: /bin/busybox
      | CPU: 0 PID: 92 Comm: modprobe Not tainted 4.12.0-rc6 #37
      | task: 9a240780 task.stack: 9a226000
      |
      |[ECR   ]: 0x00200400 => Machine Check (Other Fatal Err)
      |
      
      Which can help debugging.
      
      Cc: Alexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      aa7e3a5e
    • A
      ARC: [plat-hsdk] initial port for HSDK board · a518d637
      Alexey Brodkin 提交于
      This initial port adds support of ARC HS Development Kit board with some
      basic features such serial port, USB, SD/MMC and Ethernet.
      
      Essentially we run Linux kernel on all 4 cores (i.e. utilize SMP) and
      heavily use IO Coherency for speeding-up DMA-aware peripherals.
      
      Note as opposed to other ARC boards we link Linux kernel to
      0x9000_0000 intentionally because cores 1 and 3 configured with DCCM
      situated at our more usual link base 0x8000_0000. We still can use
      memory region starting at 0x8000_0000 as we reallocate DCCM in our
      platform code.
      
      Note that PAE remapping for DMA clients does not work due to an RTL bug,
      so CREG_PAE register must be programmed to all zeroes, otherwise it will
      cause problems with DMA to/from peripherals even if PAE40 is not used.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      a518d637
  21. 29 8月, 2017 7 次提交
  22. 11 8月, 2017 1 次提交
    • A
      arc: Mask individual IRQ lines during core INTC init · a8ec3ee8
      Alexey Brodkin 提交于
      ARC cores on reset have all interrupt lines of built-in INTC enabled.
      Which means once we globally enable interrupts (very early on boot)
      faulty hardware blocks may trigger an interrupt that Linux kernel
      cannot handle yet as corresponding handler is not yet installed.
      
      In that case system falls in "interrupt storm" and basically never
      does anything useful except entering and exiting generic IRQ handling
      code.
      
      One real example of that kind of problematic hardware is DW GMAC which
      also has interrupts enabled on reset and if Ethernet PHY informs GMAC
      about link state, GMAC immediately reports that upstream to ARC core
      and here we are.
      
      Now with that change we mask all individual IRQ lines making entire
      system more fool-proof.
      
      [This patch was motivated by Adaptrum platform support]
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Eugeniy Paltsev <paltsev@synopsys.com>
      Tested-by: NAlexandru Gagniuc <alex.g@adaptrum.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      a8ec3ee8