Re: Re: How to avoid or reduce GFP_ATOMIC allocation failed

2019-03-07 Thread greg kh
On Fri, Mar 08, 2019 at 03:34:18PM +0800, wuzhouhui wrote:
> > -Original Messages-
> > From: "Greg KH" 
> > Sent Time: 2019-03-08 15:21:52 (Friday)
> > To: wuzhouhui 
> > Cc: kernelnewbies@kernelnewbies.org
> > Subject: Re: How to avoid or reduce GFP_ATOMIC allocation failed
> > 
> > On Fri, Mar 08, 2019 at 01:37:26PM +0800, wuzhouhui wrote:
> > > Hi,
> > > 
> > > I check kernel code and found that GFP_ATOMIC allocation will
> > > use emergency pool and maybe failed if emergency pool is not
> > > enough. And GFP_ATOMIC doesn't trigger reclaim (because of
> > > ATOMIC) even if there are a lot of page caches. So my question
> > > is how to avoid or reduce GFP_ATOMIC allocation failed if there
> > > are enough reclaimable memory? Is there some kernel parameters
> > > can be configured?
> > 
> > Have you seen the ATOMIC pools be used up and not able to be reclaimed
> > in real-world usages?  If so, I'm sure the mm developers would love to
> 
> No, I haven't seen this scenario. But I encountered the similar issue
> with [1] (order is 5 in my scenario), and this issue is not resolved for
> now.

Please work with the company that created your out-of-tree kernel
networking code as it sounds like they do not know how to properly
handle this type of problem :)

good luck!

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Re: How to avoid or reduce GFP_ATOMIC allocation failed

2019-03-07 Thread wuzhouhui
> -Original Messages-
> From: "Greg KH" 
> Sent Time: 2019-03-08 15:21:52 (Friday)
> To: wuzhouhui 
> Cc: kernelnewbies@kernelnewbies.org
> Subject: Re: How to avoid or reduce GFP_ATOMIC allocation failed
> 
> On Fri, Mar 08, 2019 at 01:37:26PM +0800, wuzhouhui wrote:
> > Hi,
> > 
> > I check kernel code and found that GFP_ATOMIC allocation will
> > use emergency pool and maybe failed if emergency pool is not
> > enough. And GFP_ATOMIC doesn't trigger reclaim (because of
> > ATOMIC) even if there are a lot of page caches. So my question
> > is how to avoid or reduce GFP_ATOMIC allocation failed if there
> > are enough reclaimable memory? Is there some kernel parameters
> > can be configured?
> 
> Have you seen the ATOMIC pools be used up and not able to be reclaimed
> in real-world usages?  If so, I'm sure the mm developers would love to

No, I haven't seen this scenario. But I encountered the similar issue
with [1] (order is 5 in my scenario), and this issue is not resolved for
now.

Thanks.

[1] 
https://stackoverflow.com/questions/53936183/linux-disk-cache-and-kmalloc-with-gfp-atomic#

> hear from you about this as I really do not think that is a situation
> that can happen easily, if at all.
> 
> And no, I do not think there are any such parameters, the kernel should
> be self-tuning for things like this.
> 
> thanks,
> 
> greg k-h
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to avoid or reduce GFP_ATOMIC allocation failed

2019-03-07 Thread Greg KH
On Fri, Mar 08, 2019 at 01:37:26PM +0800, wuzhouhui wrote:
> Hi,
> 
> I check kernel code and found that GFP_ATOMIC allocation will
> use emergency pool and maybe failed if emergency pool is not
> enough. And GFP_ATOMIC doesn't trigger reclaim (because of
> ATOMIC) even if there are a lot of page caches. So my question
> is how to avoid or reduce GFP_ATOMIC allocation failed if there
> are enough reclaimable memory? Is there some kernel parameters
> can be configured?

Have you seen the ATOMIC pools be used up and not able to be reclaimed
in real-world usages?  If so, I'm sure the mm developers would love to
hear from you about this as I really do not think that is a situation
that can happen easily, if at all.

And no, I do not think there are any such parameters, the kernel should
be self-tuning for things like this.

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


How to avoid or reduce GFP_ATOMIC allocation failed

2019-03-07 Thread wuzhouhui
Hi,

I check kernel code and found that GFP_ATOMIC allocation will
use emergency pool and maybe failed if emergency pool is not
enough. And GFP_ATOMIC doesn't trigger reclaim (because of
ATOMIC) even if there are a lot of page caches. So my question
is how to avoid or reduce GFP_ATOMIC allocation failed if there
are enough reclaimable memory? Is there some kernel parameters
can be configured?

Thanks.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: exit-code of 251

2019-03-07 Thread prashantkumar dhotre
The issue is not easy to reproduce.
unable to reproduce that even after many retries.


On Thu, Mar 7, 2019 at 2:30 PM  wrote:

> On Wed, 06 Mar 2019 17:20:07 +0530, prashantkumar dhotre said:
>
> > Could you please let me know if any system call can exit with 251 ?
> > I am trying to find out who exited with 251 ?
>
> strace is your friend.
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


AW: Using EHSET module

2019-03-07 Thread CHMIELARZ Radoslaw
Hi Greg,

OK, thanks. I will ask there.

As for the system yes, we are using this module as a host.

Cheers,
Radek

-Ursprüngliche Nachricht-
Von: Greg KH  
Gesendet: czwartek, 7 marca 2019 12:53
An: CHMIELARZ Radoslaw 
Cc: kernelnewbies@kernelnewbies.org
Betreff: Re: Using EHSET module

On Thu, Mar 07, 2019 at 11:41:58AM +, CHMIELARZ Radoslaw wrote:
> Hi,
> 
> I'm trying to certify USB on our device that is running Linux 4.14.
> For windows systems we were using 
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.usb.org%2Fusb2tools&data=02%7C01%7C%7C22e9f4cc354f4e1034ae08d6a2f36c53%7C1b16ab3eb8f64fe39f3e2db7fe549f6a%7C0%7C0%7C636875563707763954&sdata=EKYvoBtS6NeeVxh%2FmRm1tkBI11SlppN9yOWcIe%2Fd6kk%3D&reserved=0.
>  For linux the only option I have found is a kernel module called EHSET.
> Unfortunately I can't manage to get it working, can You please help?

First, try asking USB questions on the linux-...@vger.kernel.org mailing list.

Secondly, the ehset module is to test things when you are running Linux as the 
host, not the device, it is to be installed on the host system.

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Using EHSET module

2019-03-07 Thread Greg KH
On Thu, Mar 07, 2019 at 11:41:58AM +, CHMIELARZ Radoslaw wrote:
> Hi,
> 
> I'm trying to certify USB on our device that is running Linux 4.14.
> For windows systems we were using https://www.usb.org/usb2tools. For
> linux the only option I have found is a kernel module called EHSET.
> Unfortunately I can't manage to get it working, can You please help?

First, try asking USB questions on the linux-...@vger.kernel.org mailing
list.

Secondly, the ehset module is to test things when you are running Linux
as the host, not the device, it is to be installed on the host system.

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Using EHSET module

2019-03-07 Thread CHMIELARZ Radoslaw
Hi,

I'm trying to certify USB on our device that is running Linux 4.14. For windows 
systems we were using https://www.usb.org/usb2tools. For linux the only option 
I have found is a kernel module called EHSET. Unfortunately I can't manage to 
get it working, can You please help?

I have added the following configuration:

  *   CONFIG_USB_HCD_TEST_MODE=y
  *   USB_EHSET_TEST_FIXTURE=m

Then on the system I type in modprobe ehset. After this looking at the source 
code of 
ehset.c
 I assumed that inserting USB stick with VendorID: 0x1a0a and ProductID: 0x0104 
would start the Packet command, but it doesn't do anything (not output visible 
on the oscilloscope). The device is loaded as a regular USB stick.

The output I see is:

[ 1059.904034] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

[ 1059.935515] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00

[ 1059.941700] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

[ 1059.948523] usb usb1: New USB device strings: Mfr=3, Product=2, 
SerialNumber=1

[ 1059.955776] usb usb1: Product: EHCI Host Controller

[ 1059.960680] usb usb1: Manufacturer: Linux 4.14.87-rt50 ehci_hcd

[ 1059.966627] usb usb1: SerialNumber: ci_hdrc.0

[ 1059.974486] usb usb1: usb_probe_device

[ 1059.982387] hub 1-0:1.0: usb_probe_interface

[ 1059.986735] hub 1-0:1.0: USB hub found

[ 1059.990614] hub 1-0:1.0: 1 port detected

[ 1060.475521] usb 1-1: new high-speed USB device number 2 using ci_hdrc

[ 1060.677970] usb 1-1: New USB device found, idVendor=1a0a, idProduct=0104

[ 1060.684709] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[ 1060.691877] usb 1-1: Product: USB DISK 3.0

[ 1060.696005] usb 1-1: Manufacturer:

[ 1060.700215] usb 1-1: SerialNumber: 190073AE389B2300

[ 1060.708279] usb 1-1: usb_probe_device

[ 1060.716351] usb-storage 1-1:1.0: usb_probe_interface

[ 1060.724692] usb-storage 1-1:1.0: USB Mass Storage device detected

[ 1060.745330] scsi host1: usb-storage 1-1:1.0

Thanks in advance!

Radek

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: exit-code of 251

2019-03-07 Thread valdis . kletnieks
On Wed, 06 Mar 2019 17:20:07 +0530, prashantkumar dhotre said:

> Could you please let me know if any system call can exit with 251 ?
> I am trying to find out who exited with 251 ?

strace is your friend.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: undefined reference to `ioctl_tty'

2019-03-07 Thread valdis . kletnieks
On Wed, 06 Mar 2019 03:50:10 -0500, Jeffrey Walton said:

> Yeah, the race seems to be the downside to ioctl and TIOEXCL.
>
> It is too bad Linux does not honor O_EXCL for the device, or provide a
> similar open flag like SOCK_NONBLOCK was added to avoid the race in
> sockets. It would avoid a lot of problems.

-ENOPATCH :)

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies