title: Global buffer of 4096 defined in kernel module causing performance issues while doing a get from a storage device
body: <p>We had a kernel module which writes into a file and we read the proc file to get some information regarding hardware operation. The hardware operation statistics data became more than 3072 bytes (PROC_BLOCK_SIZE) ; so we locally buffer the data by defining a global buffer of size 4096 bytes . Once the data is completely read then we move the data to the proc_read_kernel buffer to the local buffer. This is done as per hack (2) defined around line number 165 in linux-2.6.28/proc/fs/generic.c. We are not sending eof till the entire buffer is read so read proc will be called two times one for 3072 bytes and next for 1024 bytes. We do a memcpy to copy the data to the read proc buffer. The read proc will be invoked only by command line.</p>
  
  <p>But inserting this particular module after adding the global buffer is making some difference in the performance numbers of get from storage device . If we do not do modprobe of this kernel module then we are seeing better numbers. Logically the global buffer will be in BSS area and since the command is not called so memcpy will also not be invoked. We are not able to explain this anomaly. Any pointers will be highly helpful.</p>