Re: [PATCH v5 2/2] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-10-16 Thread Huang, Ying
"Verma, Vishal L" writes: > On Tue, 2023-10-17 at 13:18 +0800, Huang, Ying wrote: >> "Verma, Vishal L" writes: >> >> > On Thu, 2023-10-05 at 14:16 -0700, Dan Williams wrote: >> > > Vishal Verma wrote: >> > > > >> > <..> >> > >> > > > + >> > > > + rc = kstrtobool(buf, ); >> > > > +

Re: [PATCH v5 2/2] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-10-16 Thread Verma, Vishal L
On Tue, 2023-10-17 at 13:18 +0800, Huang, Ying wrote: > "Verma, Vishal L" writes: > > > On Thu, 2023-10-05 at 14:16 -0700, Dan Williams wrote: > > > Vishal Verma wrote: > > > > > > <..> > > > > > > + > > > > +   rc = kstrtobool(buf, ); > > > > +   if (rc) > > > > +   return

Re: [PATCH v5 2/2] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-10-16 Thread Huang, Ying
"Verma, Vishal L" writes: > On Thu, 2023-10-05 at 14:16 -0700, Dan Williams wrote: >> Vishal Verma wrote: >> > > <..> > >> > + >> > + rc = kstrtobool(buf, ); >> > + if (rc) >> > + return rc; >> >> Perhaps: >> >> if (dev_dax->memmap_on_memory == val) >> return

Re: [PATCH v5 2/2] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-10-16 Thread Verma, Vishal L
On Thu, 2023-10-05 at 14:16 -0700, Dan Williams wrote: > Vishal Verma wrote: > > <..> > > + > > +   rc = kstrtobool(buf, ); > > +   if (rc) > > +   return rc; > > Perhaps: > > if (dev_dax->memmap_on_memory == val) > return len; > > ...and skip the check below when

RE: [PATCH v5 2/2] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-10-05 Thread Dan Williams
Vishal Verma wrote: > Large amounts of memory managed by the kmem driver may come in via CXL, > and it is often desirable to have the memmap for this memory on the new > memory itself. > > Enroll kmem-managed memory for memmap_on_memory semantics if the dax > region originates via CXL. For

[PATCH v5 2/2] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-10-05 Thread Vishal Verma
Large amounts of memory managed by the kmem driver may come in via CXL, and it is often desirable to have the memmap for this memory on the new memory itself. Enroll kmem-managed memory for memmap_on_memory semantics if the dax region originates via CXL. For non-CXL dax regions, retain the