search for: might_sleep

Displaying 20 results from an estimated 116 matches for "might_sleep".

2018 Apr 10
2
[PATCH v29 1/4] mm: support reporting free page blocks
...r questions answered? If yes could I bother you for an ack on this? > Still not very happy that readers are told that "this function may sleep" when it clearly doesn't do so. If we wish to be able to change it to sleep in the future then that should be mentioned. And even put a might_sleep() in there, to catch people who didn't read the comments... Otherwise it looks OK.
2018 Apr 10
2
[PATCH v29 1/4] mm: support reporting free page blocks
...r questions answered? If yes could I bother you for an ack on this? > Still not very happy that readers are told that "this function may sleep" when it clearly doesn't do so. If we wish to be able to change it to sleep in the future then that should be mentioned. And even put a might_sleep() in there, to catch people who didn't read the comments... Otherwise it looks OK.
2020 Aug 05
0
[PATCH v3 23/38] virtio_config: cread/write cleanup
...c3b02245ecd 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -444,53 +444,60 @@ static inline void virtio_cwrite8(struct virtio_device *vdev, static inline u16 virtio_cread16(struct virtio_device *vdev, unsigned int offset) { - u16 ret; + __virtio16 ret; might_sleep(); vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return virtio16_to_cpu(vdev, (__force __virtio16)ret); + return virtio16_to_cpu(vdev, ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + __virtio16 v; + might_sl...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...ctname, member, val) \ > + /* Must match the member's type, and be integer */ \ > + typecheck(__virtio_native_type(structname, member), (val)) > + > + > /* Config space accessors. */ > #define virtio_cread(vdev, structname, member, ptr) \ > do { \ > might_sleep(); \ > /* Must match the member's type, and be integer */ \ > - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ > + if (!__virtio_typecheck(structname, member, *(ptr))) \ > (*ptr) = 1; \ A silly question,? compare to using set()/get() directly,...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...ctname, member, val) \ > + /* Must match the member's type, and be integer */ \ > + typecheck(__virtio_native_type(structname, member), (val)) > + > + > /* Config space accessors. */ > #define virtio_cread(vdev, structname, member, ptr) \ > do { \ > might_sleep(); \ > /* Must match the member's type, and be integer */ \ > - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ > + if (!__virtio_typecheck(structname, member, *(ptr))) \ > (*ptr) = 1; \ A silly question,? compare to using set()/get() directly,...
2020 Aug 05
0
[PATCH v3 24/38] virtio_config: rewrite using _Generic
...val) \ - /* Must match the member's type, and be integer */ \ - typecheck(__virtio_native_type(structname, member), (val)) - + typeof(virtio_to_cpu(NULL, ((structname*)0)->member)) /* Config space accessors. */ #define virtio_cread(vdev, structname, member, ptr) \ do { \ - might_sleep(); \ - /* Must match the member's type, and be integer */ \ - if (!__virtio_typecheck(structname, member, *(ptr))) \ - (*ptr) = 1; \ + typeof(((structname*)0)->member) virtio_cread_v; \ \ - switch (sizeof(*ptr)) { \ + might_sleep(); \ + /* Sanity check: mu...
2019 Jan 03
1
[PATCH 2/2] virtio: document virtio_config_ops restrictions
...et/@set, @get_status/@set_status, or @get_features/ > + * @finalize_features are NOT safe to be called from an atomic > + * context. > * @get: read the value of a configuration field > * vdev: the virtio_device > * offset: the offset of the configuration field Then might_sleep in virtio_cread/virtio_cwrite and friends would be appropriate? I guess we'll need to fix balloon first. > -- > 2.17.2
2020 Nov 03
0
[patch V3 22/37] highmem: High implementation details and document API
...g addr) { } +#endif + +#ifndef kmap_prot +#define kmap_prot PAGE_KERNEL +#endif + +void *kmap_high(struct page *page); +void kunmap_high(struct page *page); +void __kmap_flush_unused(void); +struct page *__kmap_to_page(void *addr); + +static inline void *kmap(struct page *page) +{ + void *addr; + + might_sleep(); + if (!PageHighMem(page)) + addr = page_address(page); + else + addr = kmap_high(page); + kmap_flush_tlb((unsigned long)addr); + return addr; +} + +static inline void kunmap(struct page *page) +{ + might_sleep(); + if (!PageHighMem(page)) + return; + kunmap_high(page); +} + +static inline str...
2020 Aug 06
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
On 2020/8/5 ??7:45, Michael S. Tsirkin wrote: >>> #define virtio_cread(vdev, structname, member, ptr) \ >>> do { \ >>> might_sleep(); \ >>> /* Must match the member's type, and be integer */ \ >>> - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ >>> + if (!__virtio_typecheck(structname, member, *(ptr))) \ >>> (*ptr) = 1; \ >> A silly question...
2020 Aug 06
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
On 2020/8/5 ??7:45, Michael S. Tsirkin wrote: >>> #define virtio_cread(vdev, structname, member, ptr) \ >>> do { \ >>> might_sleep(); \ >>> /* Must match the member's type, and be integer */ \ >>> - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ >>> + if (!__virtio_typecheck(structname, member, *(ptr))) \ >>> (*ptr) = 1; \ >> A silly question...
2009 Oct 02
0
Disaster at annarchy
...e32_to_cpu(*(uint32_t *)&(x)) > >> > > >> > @@ -50,6 +48,15 @@ struct init_exec { > >> > bool repeat; > >> > }; > >> > > >> > +static inline void bios_usleep(unsigned usecs) > >> > +{ > >> > + might_sleep(); > >> > + if (usecs < 1000 * MAX_UDELAY_MS) > >> > + udelay(usecs); > >> > + else > >> > + msleep(usecs / 1000 + 1); > >> > +} > > > > This function is to replace the BIOS_USLEEP() macro with > > something, that w...
2020 Nov 03
0
[patch V3 23/37] sched: Make migrate_disable/enable() independent of RT
...45 +++++++++++++++++++++++++++++++++++---------- kernel/sched/sched.h | 4 ++-- lib/smp_processor_id.c | 2 +- 6 files changed, 56 insertions(+), 56 deletions(-) --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -204,6 +204,7 @@ extern int _cond_resched(void); extern void ___might_sleep(const char *file, int line, int preempt_offset); extern void __might_sleep(const char *file, int line, int preempt_offset); extern void __cant_sleep(const char *file, int line, int preempt_offset); +extern void __cant_migrate(const char *file, int line); /** * might_sleep - annotation for fu...
2020 Nov 03
1
[patch V3 22/37] highmem: High implementation details and document API
On Tue, Nov 3, 2020 at 2:33 AM Thomas Gleixner <tglx at linutronix.de> wrote: > > +static inline void *kmap(struct page *page) > +{ > + void *addr; > + > + might_sleep(); > + if (!PageHighMem(page)) > + addr = page_address(page); > + else > + addr = kmap_high(page); > + kmap_flush_tlb((unsigned long)addr); > + return addr; > +} > + > +static inline void kunmap(struct page *page) > +...
2018 Apr 10
0
[PATCH v29 1/4] mm: support reporting free page blocks
...ould I bother you for an ack on this? > > > > Still not very happy that readers are told that "this function may > sleep" when it clearly doesn't do so. If we wish to be able to change > it to sleep in the future then that should be mentioned. And even put a > might_sleep() in there, to catch people who didn't read the comments... > > Otherwise it looks OK. Oh, might_sleep with a comment explaining it's for the future sounds good to me. I queued this - Wei, could you post a patch on top pls? -- MST
2020 Aug 05
0
[PATCH v3 26/38] virtio_config: LE config space accessors
...(x), \ + __le16: cpu_to_le16(x), \ + __le32: cpu_to_le32(x), \ + __le64: cpu_to_le64(x) \ + ) + +/* LE (e.g. modern) Config space accessors. */ +#define virtio_cread_le(vdev, structname, member, ptr) \ + do { \ + typeof(((structname*)0)->member) virtio_cread_v; \ + \ + might_sleep(); \ + /* Sanity check: must match the member's type */ \ + typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \ + \ + switch (sizeof(virtio_cread_v)) { \ + case 1: \ + case 2: \ + case 4: \ + vdev->config->get((vdev), \ + offset...
2020 Aug 03
0
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...t;member) + +#define __virtio_typecheck(structname, member, val) \ + /* Must match the member's type, and be integer */ \ + typecheck(__virtio_native_type(structname, member), (val)) + + /* Config space accessors. */ #define virtio_cread(vdev, structname, member, ptr) \ do { \ might_sleep(); \ /* Must match the member's type, and be integer */ \ - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ + if (!__virtio_typecheck(structname, member, *(ptr))) \ (*ptr) = 1; \ \ switch (sizeof(*ptr)) { \ @@ -322,7 +368,7 @@ static inline __...
2020 Aug 05
0
[PATCH v3 03/38] virtio: allow __virtioXX, __leXX in config space
...t;member) + +#define __virtio_typecheck(structname, member, val) \ + /* Must match the member's type, and be integer */ \ + typecheck(__virtio_native_type(structname, member), (val)) + + /* Config space accessors. */ #define virtio_cread(vdev, structname, member, ptr) \ do { \ might_sleep(); \ /* Must match the member's type, and be integer */ \ - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ + if (!__virtio_typecheck(structname, member, *(ptr))) \ (*ptr) = 1; \ \ switch (sizeof(*ptr)) { \ @@ -322,7 +368,7 @@ static inline __...
2019 Feb 13
1
[PATCH RFC] virtio: hint if callbacks surprisingly might sleep
...can be very surprising for developers using the much more > > common virtio-pci transport, just to find out that things break > > when used on s390. > > > > The documentation for virtio_config_ops now contains a comment > > explaining this, but it makes sense to add a might_sleep() annotation > > to various wrapper functions in the virtio core to avoid surprises > > later. > > > > Note that annotations are NOT added to two classes of calls: > > - direct calls from device drivers (all current callers should be > > fine, however) > &g...
2019 Feb 13
1
[PATCH RFC] virtio: hint if callbacks surprisingly might sleep
...can be very surprising for developers using the much more > > common virtio-pci transport, just to find out that things break > > when used on s390. > > > > The documentation for virtio_config_ops now contains a comment > > explaining this, but it makes sense to add a might_sleep() annotation > > to various wrapper functions in the virtio core to avoid surprises > > later. > > > > Note that annotations are NOT added to two classes of calls: > > - direct calls from device drivers (all current callers should be > > fine, however) > &g...
2020 Aug 05
0
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...ust match the member's type, and be integer */ \ > > + typecheck(__virtio_native_type(structname, member), (val)) > > + > > + > > /* Config space accessors. */ > > #define virtio_cread(vdev, structname, member, ptr) \ > > do { \ > > might_sleep(); \ > > /* Must match the member's type, and be integer */ \ > > - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ > > + if (!__virtio_typecheck(structname, member, *(ptr))) \ > > (*ptr) = 1; \ > > > A silly question,? com...