Thread (6 messages) 6 messages, 3 authors, 2020-09-04

Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2020-08-28 06:17:18
Also in: lkml

Possibly related (same subject, not in this thread)

On Thu, Aug 27, 2020 at 05:25:23PM -0700, Iouri Tarassov wrote:
quoted
quoted
+{
+	struct dxgprocess_adapter *adapter_info = dxgmem_alloc(process,
+							       DXGMEM_PROCESS_ADAPTER,
+							       sizeof
+							       (*adapter_info));
We normally use kernel functions in kernel code.
Using a custom memory allocation function allows us to track memory
allocations per DXGPROCESS and catch memory leaks when a DXGPROCESS is
destroyed or when the driver is unloaded. It also allows to easily change
the memory allocation implementation if needed.
There is only one "memory allocation implementation" in the kernel,
please use that and not any wrapper functions.  You wouldn't want to see
1000's of different memory allocation functions, each driver having a
unique one, right?

Remember, your code is becoming part of the larger kernel, so follow the
guidelines and rules of it.  There is nothing different from your code
and a serial port driver when it comes to these expectations.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help