kisskb: OK linus/axs101_defconfig/arcompact Fri Jan 11, 03:27
OK linus/axs101_defconfig/arcompact Fri Jan 11, 03:27 http://kisskb.ellerman.id.au/kisskb/buildresult/13647358/ Commit: mm/mmu_notifier: mm/rmap.c: Fix a mmu_notifier range bug in try_to_unmap_one ba422731316dde1e22dcc84b83c7349dc0ce1c3c Compiler: arc-buildroot-linux-uclibc-gcc (Buildroot 2015.08.1) 4.8.4 / GNU ld (GNU Binutils) 2.23.2 Possible errors --- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" Possible warnings (8) -- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast [enabled by default] arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] net/ipv4/tcp_input.c:4324:49: warning: array subscript is above array bounds [-Warray-bounds] arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
kisskb: OK linus/axs103_smp_defconfig/arcv2 Fri Jan 11, 03:27
OK linus/axs103_smp_defconfig/arcv2 Fri Jan 11, 03:27 http://kisskb.ellerman.id.au/kisskb/buildresult/13647357/ Commit: mm/mmu_notifier: mm/rmap.c: Fix a mmu_notifier range bug in try_to_unmap_one ba422731316dde1e22dcc84b83c7349dc0ce1c3c Compiler: arc-linux-gcc.br_real (Buildroot 2016.11-git-00613-ge98b4dd) 6.2.1 20160824 / GNU ld (GNU Binutils) 2.27.51.20160928 Possible errors --- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" #define KERN_ERR KERN_SOH "3" /* error conditions */ #define KERN_ERR KERN_SOH "3" /* error conditions */ #define KERN_ERR KERN_SOH "3" /* error conditions */ Possible warnings (83) -- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" arch/arc/mm/tlb.c:914:2: warning: ISO C90 forbids variable length array 'pd0' [-Wvla] kernel/dma/direct.c:40:4: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=] #define KERN_WARNING KERN_SOH "4" /* warning conditions */ include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=] #define KERN_WARNING KERN_SOH "4" /* warning conditions */ mm/percpu.c:1948:27: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:32: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:37: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:42: warning: format '%zu' expects argument of type 'size_t', but argument 6 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:52: warning: format '%zu' expects argument of type 'size_t', but argument 7 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:56: warning: format '%zu' expects argument of type 'size_t', but argument 8 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 6 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 7 has type 'unsigned int' [-Wformat=] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast drivers/base/component.c:164:24: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] drivers/base/regmap/regmap.c:1531:22: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] fs/ext4/inode.c:3654:12: warning: format '%zd' expects argument of type 'signed size_t', but argument 6 has type 'ssize_t {aka int}' [-Wformat=] drivers/base/regmap/regcache.c:719:20: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kern_levels.h:5:18: warning: format '%
Re: [PATCH v2 2/4] ARC: perf: introduce Kernel PMU events support
ping ! Peter, does this look ok to you ? On 12/13/18 8:56 AM, Eugeniy Paltsev wrote: > Export all available ARC architected hardware events as > kernel PMU events to make non-generic events accessible. > > ARC PMU HW allow us to read the list of all available > events names. So we generate kernel PMU event list > dynamically in arc_pmu_device_probe() using > human-readable events names we got from HW instead of > using pre-defined events list. > > -->8-- > $ perf list > [snip] > arc_pmu/bdata64/ [Kernel PMU event] > arc_pmu/bdcstall/ [Kernel PMU event] > arc_pmu/bdslot/ [Kernel PMU event] > arc_pmu/bfbmp/[Kernel PMU event] > arc_pmu/bfirqex/ [Kernel PMU event] > arc_pmu/bflgstal/ [Kernel PMU event] > arc_pmu/bflush/ [Kernel PMU event] > -->8-- > > Signed-off-by: Eugeniy Paltsev > --- > Changes v1->v2: > * Rename "arc_pmu" to "arc_pct" > * Trivial changes > > arch/arc/kernel/perf_event.c | 106 > ++- > 1 file changed, 105 insertions(+), 1 deletion(-) > > diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c > index 693f32d60c35..d60aaaead421 100644 > --- a/arch/arc/kernel/perf_event.c > +++ b/arch/arc/kernel/perf_event.c > @@ -17,12 +17,28 @@ > /* HW holds 8 symbols + one for null terminator */ > #define ARCPMU_EVENT_NAME_LEN9 > > +enum arc_pmu_attr_groups { > + ARCPMU_ATTR_GR_EVENTS, > + ARCPMU_ATTR_GR_FORMATS, > + ARCPMU_NR_ATTR_GR > +}; > + > +struct arc_pmu_raw_event_entry { > + char name[ARCPMU_EVENT_NAME_LEN]; > +}; > + > struct arc_pmu { > struct pmu pmu; > unsigned intirq; > int n_counters; > + int n_events; > u64 max_period; > int ev_hw_idx[PERF_COUNT_ARC_HW_MAX]; > + > + struct arc_pmu_raw_event_entry *raw_entry; > + struct attribute**attrs; > + struct perf_pmu_events_attr *attr; > + const struct attribute_group*attr_groups[ARCPMU_NR_ATTR_GR + 1]; > }; > > struct arc_pmu_cpu { > @@ -192,6 +208,17 @@ static int arc_pmu_event_init(struct perf_event *event) >(int)hwc->config, arc_pmu_ev_hw_map[ret]); > return 0; > > + case PERF_TYPE_RAW: > + if (event->attr.config >= arc_pmu->n_events) > + return -ENOENT; > + > + hwc->config |= event->attr.config; > + pr_debug("init raw event with idx %lld \'%s\'\n", > + event->attr.config, > + arc_pmu->raw_entry[event->attr.config].name); > + > + return 0; > + > default: > return -ENOENT; > } > @@ -442,6 +469,67 @@ static void arc_cpu_pmu_irq_init(void *data) > write_aux_reg(ARC_REG_PCT_INT_ACT, 0x); > } > > +/* Event field occupies the bottom 15 bits of our config field */ > +PMU_FORMAT_ATTR(event, "config:0-14"); > +static struct attribute *arc_pmu_format_attrs[] = { > + &format_attr_event.attr, > + NULL, > +}; > + > +static struct attribute_group arc_pmu_format_attr_gr = { > + .name = "format", > + .attrs = arc_pmu_format_attrs, > +}; > + > +static ssize_t arc_pmu_events_sysfs_show(struct device *dev, > + struct device_attribute *attr, > + char *page) > +{ > + struct perf_pmu_events_attr *pmu_attr; > + > + pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); > + return sprintf(page, "event=0x%04llx\n", pmu_attr->id); > +} > + > +/* > + * We don't add attrs here as we don't have pre-defined list of perf events. > + * We will generate and add attrs dynamically in probe() after we read HW > + * configuration. > + */ > +static struct attribute_group arc_pmu_events_attr_gr = { > + .name = "events", > +}; > + > +static void arc_pmu_add_raw_event_attr(int j, char *str) > +{ > + memmove(arc_pmu->raw_entry[j].name, str, ARCPMU_EVENT_NAME_LEN - 1); > + arc_pmu->attr[j].attr.attr.name = arc_pmu->raw_entry[j].name; > + arc_pmu->attr[j].attr.attr.mode = VERIFY_OCTAL_PERMISSIONS(0444); > + arc_pmu->attr[j].attr.show = arc_pmu_events_sysfs_show; > + arc_pmu->attr[j].id = j; > + arc_pmu->attrs[j] = &(arc_pmu->attr[j].attr.attr); > +} > + > +static int arc_pmu_raw_alloc(struct device *dev) > +{ > + arc_pmu->attr = devm_kmalloc_array(dev, arc_pmu->n_events + 1, > + sizeof(*arc_pmu->attr), GFP_KERNEL | __GFP_ZERO); > + if (!arc_pmu->attr) > + return -ENOMEM; > + > + arc_pmu->attrs = devm_kmalloc_array(dev, arc_pmu->n_events + 1, > + sizeof(*arc_pmu->attrs), GFP_KERNEL | __GFP_ZERO); > + if (!arc_pmu->attrs) > + return -ENOME
kisskb: OK linus/axs103_smp_defconfig/arcv2 Fri Jan 11, 06:36
OK linus/axs103_smp_defconfig/arcv2 Fri Jan 11, 06:36 http://kisskb.ellerman.id.au/kisskb/buildresult/13647874/ Commit: csky: fixup compile error with CPU 810. 70c25259537c073584eb906865307687275b527f Compiler: arc-linux-gcc.br_real (Buildroot 2016.11-git-00613-ge98b4dd) 6.2.1 20160824 / GNU ld (GNU Binutils) 2.27.51.20160928 Possible errors --- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" #define KERN_ERR KERN_SOH "3" /* error conditions */ #define KERN_ERR KERN_SOH "3" /* error conditions */ #define KERN_ERR KERN_SOH "3" /* error conditions */ Possible warnings (83) -- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" arch/arc/mm/tlb.c:914:2: warning: ISO C90 forbids variable length array 'pd0' [-Wvla] kernel/dma/direct.c:40:4: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=] #define KERN_WARNING KERN_SOH "4" /* warning conditions */ include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=] #define KERN_WARNING KERN_SOH "4" /* warning conditions */ mm/percpu.c:1948:27: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:32: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:37: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:42: warning: format '%zu' expects argument of type 'size_t', but argument 6 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:52: warning: format '%zu' expects argument of type 'size_t', but argument 7 has type 'unsigned int' [-Wformat=] mm/percpu.c:1948:56: warning: format '%zu' expects argument of type 'size_t', but argument 8 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 6 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 7 has type 'unsigned int' [-Wformat=] include/linux/kern_levels.h:5:18: warning: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t {aka unsigned int}' [-Wformat=] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast fs/ext4/inode.c:3654:12: warning: format '%zd' expects argument of type 'signed size_t', but argument 6 has type 'ssize_t {aka int}' [-Wformat=] drivers/base/regmap/regmap.c:1531:22: warning: format '%zu' expects argument of type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=] drivers/base/component.c:164:24: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=] drivers/base/regmap/regcache.c:719:20: warning: format '%zu' expects argum
kisskb: OK linus/axs101_defconfig/arcompact Fri Jan 11, 06:37
OK linus/axs101_defconfig/arcompact Fri Jan 11, 06:37 http://kisskb.ellerman.id.au/kisskb/buildresult/13647875/ Commit: csky: fixup compile error with CPU 810. 70c25259537c073584eb906865307687275b527f Compiler: arc-buildroot-linux-uclibc-gcc (Buildroot 2015.08.1) 4.8.4 / GNU ld (GNU Binutils) 2.23.2 Possible errors --- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" Possible warnings (8) -- arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected "54" arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): /axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected "57" arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast [enabled by default] arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] net/ipv4/tcp_input.c:4324:49: warning: array subscript is above array bounds [-Warray-bounds] ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [Buildroot] [PATCH] azure-iot-sdk-c: Bump to version 2018-12-13
On 30/12/2018 22:41, Thomas Petazzoni wrote: > Hello, > > On Fri, 21 Dec 2018 20:37:29 +0300, Nikita Sobolev wrote: >> From: NikitaSobolev >> >> Bump azure-iot-sdk-c to 2018-12-13 release. >> Add patch, that removes Windows specified variables from >> azure-iot-sdk-c-2018-12-13 release. That variables cause >> build errors. >> >> Signed-off-by: Nikita Sobolev > > So, I looked into this. Indeed, without the patch, the build fails with: > > CMake Error at c-utility/CMakeLists.txt:267 (if): > if given arguments: > > "WIN32" "AND" "(" "VERSION_EQUAL" "10.0.17763.0" "OR" "VERSION_GREATER" > "10.0.17763.0" ")" > > Unknown arguments specified > > The problem comes from the fact that ${CMAKE_SYSTEM_VERSION} is empty. > And the CMake documentation > (https://cmake.org/cmake/help/v3.4/variable/CMAKE_SYSTEM_VERSION.html) > explains why: > > When the CMAKE_SYSTEM_NAME variable is set explicitly to enable cross > compiling then the value of CMAKE_SYSTEM_VERSION must also be set > explicitly to specify the target system version. > > We are defining CMAKE_SYSTEM_NAME in our toolchain file, but not > CMAKE_SYSTEM_VERSION. > > So for now, I simply defined CMAKE_SYSTEM_VERSION locally in > azure-iot-sdk-c, and dropped the patch. Long term, perhaps we should > define CMAKE_SYSTEM_VERSION in our toolchain file. I'm not sure who is > maintaining our CMake infrastructure these days, Samuel Martin used to > do it, but he is no longer very active. Indeed, it should be set in the toolchain file. CMAKE_SYSTEM_VERSION is the output of `uname -r` of the target system, i.e. the kernel version. We don't have that, but we do have BR2_TOOLCHAIN_HEADERS_AT_LEAST which should be good enough. Regards, Arnout ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 0/3] Replace opencoded set_mask_bits
Hi, I did these a while back and forget. Rebased to 5.0-rc1. Please consider applying. Thx, -Vineet Vineet Gupta (3): coredump: Replace opencoded set_mask_bits() fs: inode_set_flags() replace opencoded set_mask_bits() bitops.h: set_mask_bits() to return old value fs/exec.c | 7 +-- fs/inode.c | 8 +--- include/linux/bitops.h | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 3/3] bitops.h: set_mask_bits() to return old value
| > Also, set_mask_bits is used in fs quite a bit and we can possibly come up | > with a generic llsc based implementation (w/o the cmpxchg loop) | | May I also suggest changing the return value of set_mask_bits() to old. | | You can compute the new value given old, but you cannot compute the old | value given new, therefore old is the better return value. Also, no | current user seems to use the return value, so changing it is without | risk. Link: http://lkml.kernel.org/g/20150807110955.gh16...@twins.programming.kicks-ass.net Suggested-by: Peter Zijlstra Cc: Miklos Szeredi Cc: Ingo Molnar Cc: Jani Nikula Cc: Chris Wilson Cc: Andrew Morton Cc: Will Deacon Signed-off-by: Vineet Gupta --- include/linux/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 705f7c442691..602af23b98c7 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -246,7 +246,7 @@ static __always_inline void __assign_bit(long nr, volatile unsigned long *addr, new__ = (old__ & ~mask__) | bits__; \ } while (cmpxchg(ptr, old__, new__) != old__); \ \ - new__; \ + old__; \ }) #endif -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 2/3] fs: inode_set_flags() replace opencoded set_mask_bits()
It seems that 5f16f3225b0624 and 00a1a053ebe5, both with same commitlog ("ext4: atomically set inode->i_flags in ext4_set_inode_flags()") introduced the set_mask_bits API, but somehow missed not using it in ext4 in the end Also, set_mask_bits is used in fs quite a bit and we can possibly come up with a generic llsc based implementation (w/o the cmpxchg loop) Cc: Alexander Viro Cc: Theodore Ts'o Cc: Peter Zijlstra (Intel) Cc: linux-fsde...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Vineet Gupta --- fs/inode.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 0cd47fe0dbe5..799b0c4beda8 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2096,14 +2096,8 @@ EXPORT_SYMBOL(inode_dio_wait); void inode_set_flags(struct inode *inode, unsigned int flags, unsigned int mask) { - unsigned int old_flags, new_flags; - WARN_ON_ONCE(flags & ~mask); - do { - old_flags = READ_ONCE(inode->i_flags); - new_flags = (old_flags & ~mask) | flags; - } while (unlikely(cmpxchg(&inode->i_flags, old_flags, - new_flags) != old_flags)); + set_mask_bits(&inode->i_flags, mask, flags); } EXPORT_SYMBOL(inode_set_flags); -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 1/3] coredump: Replace opencoded set_mask_bits()
Cc: Alexander Viro Cc: Peter Zijlstra (Intel) Cc: linux-fsde...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Link: http://lkml.kernel.org/g/20150807115710.ga16...@redhat.com Acked-by: Oleg Nesterov Signed-off-by: Vineet Gupta --- fs/exec.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index fb72d36f7823..df7f05362283 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1944,15 +1944,10 @@ EXPORT_SYMBOL(set_binfmt); */ void set_dumpable(struct mm_struct *mm, int value) { - unsigned long old, new; - if (WARN_ON((unsigned)value > SUID_DUMP_ROOT)) return; - do { - old = READ_ONCE(mm->flags); - new = (old & ~MMF_DUMPABLE_MASK) | value; - } while (cmpxchg(&mm->flags, old, new) != old); + set_mask_bits(&mm->flags, MMF_DUMPABLE_MASK, value); } SYSCALL_DEFINE3(execve, -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 1/3] coredump: Replace opencoded set_mask_bits()
On 1/10/19 4:26 PM, Vineet Gupta wrote: > Cc: Alexander Viro > Cc: Peter Zijlstra (Intel) > Cc: linux-fsde...@vger.kernel.org > Cc: linux-ker...@vger.kernel.org > Link: http://lkml.kernel.org/g/20150807115710.ga16...@redhat.com > Acked-by: Oleg Nesterov > Signed-off-by: Vineet Gupta Reviewed-by: Anthony Yznaga ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 3/3] bitops.h: set_mask_bits() to return old value
On 1/10/19 4:26 PM, Vineet Gupta wrote: > | > Also, set_mask_bits is used in fs quite a bit and we can possibly come up > | > with a generic llsc based implementation (w/o the cmpxchg loop) > | > | May I also suggest changing the return value of set_mask_bits() to old. > | > | You can compute the new value given old, but you cannot compute the old > | value given new, therefore old is the better return value. Also, no > | current user seems to use the return value, so changing it is without > | risk. > > Link: > http://lkml.kernel.org/g/20150807110955.gh16...@twins.programming.kicks-ass.net > Suggested-by: Peter Zijlstra > Cc: Miklos Szeredi > Cc: Ingo Molnar > Cc: Jani Nikula > Cc: Chris Wilson > Cc: Andrew Morton > Cc: Will Deacon > Signed-off-by: Vineet Gupta > Reviewed-by: Anthony Yznaga ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 2/3] fs: inode_set_flags() replace opencoded set_mask_bits()
On 1/10/19 4:26 PM, Vineet Gupta wrote: > It seems that 5f16f3225b0624 and 00a1a053ebe5, both with same commitlog > ("ext4: atomically set inode->i_flags in ext4_set_inode_flags()") > introduced the set_mask_bits API, but somehow missed not using it in > ext4 in the end > > Also, set_mask_bits is used in fs quite a bit and we can possibly come up > with a generic llsc based implementation (w/o the cmpxchg loop) > > Cc: Alexander Viro > Cc: Theodore Ts'o > Cc: Peter Zijlstra (Intel) > Cc: linux-fsde...@vger.kernel.org > Cc: linux-ker...@vger.kernel.org > Signed-off-by: Vineet Gupta > Reviewed-by: Anthony Yznaga ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc