All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sadanand Warrier <sadanandwarrier@gmail.com>
To: FMDF <fmdefrancesco@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Contiguous Memory Allocator (CMA)
Date: Sat, 8 Jan 2022 17:49:18 -0500	[thread overview]
Message-ID: <CADJuq2yxegZXK8VKmpkBEmGazKRaKdv5phBpZdcxvoG=7i1GSg@mail.gmail.com> (raw)
In-Reply-To: <CAPj211udrrGpkRs3frp5bVWpfJBks9-OoJKOpDtBZ=qeV+_2HA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2715 bytes --]

Hello Fabio,
I haven't done it because I haven't had time and CONFIG_DMA_CMA has not
been enabled in the kernel I was fooling with. Yes I do know how to build
the kernel.
Thanks for all the help. Once I get it working I'll let you know.
Cheerio
S

On Sat, Jan 8, 2022, 17:14 FMDF <fmdefrancesco@gmail.com> wrote:

> On Sat, 8 Jan 2022, 14:37 Sadanand Warrier, <sadanandwarrier@gmail.com>
> wrote:
>
>> Hello Fabio
>>    Thanks for the response. I had already accessed that link that you
>> have pasted. Michal Nazarewicz also has a few other points on using
>> CMA.
>> When I tried to use the API after setting cma=128M on the kernel boot
>> command line and booted the kernel, the api returned without
>> allocating memory
>> when the driver was installed.
>> The dmesg shows that 128M was reserved for CMA but dma_alloc_coherent
>> failed.
>> It seems that default CentOS and perhaps Ubuntu kernels are not
>> compiled with CONFIG_DMA_CMA=yes for the dma_alloc_coherent to work.
>> I'm not sure if this is a valid assumption. I haven't tried
>> recompiling the kernel yet with that option set.
>> From what I have managed to eke out we need CONFIG_CMA=yes and
>> CONFIG_DMA_CMA=yes too.
>>
>
> If I recall it well, I think they are needed. Why haven't you yet checked?
>
> I assume that you know how to change your .config, re-build the kernel and
> the modules and install everything in the right places. Don't you?
>
>>
> Just grep  the ".config" of your distro. It should be placed in /boot/
> with a name like "config-`uname -r`" or in /usr/src/linux/ with its true
> name (.config) and see if those options are enabled. Or you may use
> directly "make menuconfig" and search with its special keys. Then "make -jN
> && sudo make modules_install install" (and hope that installkernel is not
> broken like it has been in openSUSE Tumbleweed for weeks).  :(
>
> I'm not an expert about this particular subject, so if they have already
> been  enabled I cannot help you with more than the above information. That
> article in lwn.net is everything I've studied about this subject and I
> haven't ever used it in kernel programming.
>
> Regards,
>
> Fabio M. De Francesco
>
>
>> Thanks
>> S
>>
>>
>> On Sat, 8 Jan 2022 at 07:23, FMDF <fmdefrancesco@gmail.com> wrote:
>> >
>> > On Tue, 21 Dec 2021, 15:36 Sadanand Warrier, <sadanandwarrier@gmail.com>
>> wrote:
>> >>
>> >> Hello
>> >>     Is CMA still supported as described in this document
>> >> https://lwn.net/Articles/396707/ ?
>> >
>> >
>> > Yes, it is.
>> >
>> > Read the following instructions on how to use that feature:
>> >
>> > "A deep dive into CMA" at
>> > https://lwn.net/Articles/486301/
>> >
>> > Regards,
>> >
>> > Fabio M. De Francesco
>> >
>>
>

[-- Attachment #1.2: Type: text/html, Size: 4703 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

      reply	other threads:[~2022-01-08 22:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 14:35 Contiguous Memory Allocator (CMA) Sadanand Warrier
2022-01-08 12:22 ` FMDF
2022-01-08 13:37   ` Sadanand Warrier
2022-01-08 22:14     ` FMDF
2022-01-08 22:49       ` Sadanand Warrier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADJuq2yxegZXK8VKmpkBEmGazKRaKdv5phBpZdcxvoG=7i1GSg@mail.gmail.com' \
    --to=sadanandwarrier@gmail.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.