lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGsJ_4xXZBWYidO1RYMLJzb_iTS21wAv7HQqP-oeVVx8x336bw@mail.gmail.com>
Date:	Thu, 5 Jul 2012 16:44:31 +0800
From:	Barry Song <21cnbao@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	linux-arm-kernel@...ts.infradead.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, workgroup.linux@....com,
	mina86@...a86.com, Barry Song <Baohua.Song@....com>,
	Barry Song <Barry.Song@....com>,
	Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH v4 RESEND] mm: cma: add a simple kernel module as the
 helper to test CMA

Hi Arnd,

2012/7/5 Arnd Bergmann <arnd@...db.de>:
>
> I think it should be in mm/cma-test.c, along with kmemleak-test.c. It would be nice
> if you could add some code that just runs at boot time (or when the module is
> loaded) and allocates and frees memory using CMA.
>
>> +static struct device *cma_dev;
>
> Do you actually need this device? It's not connected to hardware so
> it doesn't actually do DMA and we might as well pass a NULL pointer
> into dma_alloc_*().
>
>> +static const struct file_operations cma_test_fops = {
>> +     .owner =    THIS_MODULE,
>> +     .read  =    cma_test_read,
>> +     .write =    cma_test_write,
>> +};
>> +
>> +static struct miscdevice cma_test_misc = {
>> +     .name = "cma_test",
>> +     .fops = &cma_test_fops,
>> +};
>> +
>> +static int __init cma_test_init(void)
>> +{
>> +     int ret = misc_register(&cma_test_misc);
>
> A better place for this is really debugfs. The driver is not meant as a stable
> kernel interface that applications can rely on, it's purely a debugging help.
>
> Just make this
>
>         ret = debugfs_create_file("cma-test", 0600, NULL, NULL, &cma_test_fops);
>

we did have some discussions about this at:
http://www.spinics.net/lists/arm-kernel/msg163548.html

i'd say both are acceptable to me.

>         Arnd
>

-barry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ