pSendDmaPool = dma_pool_create("DmaPool",pci_dev->dev), (size_t)(512 * 64*1024+1024), (size_t)(64*1024), (size_t)0);
pDmaBuf = (unsigned char*)dma_pool_alloc(pSendDmaPool, GFP_KERNEL, &dma_handle);
我的平台是64位X86,我执行完dma_pool_create后,再执行dma_pool_alloc,就崩溃了,然后打印信息是:
------------[ cut here ]------------
WARNING: at mm/page_alloc.c:2139 __alloc_pages_nodemask+0x7a8/0x8d0() (Not tainted)
Hardware name: All Series
Modules linked in: fh130drv(U) ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle bridge autofs4 8021q garp stp llc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 vhost_net macvtap macvlan tun kvm uinput ppdev iTCO_wdt iTCO_vendor_support microcode parport_pc parport r8169 mii sg serio_raw lpc_ich mfd_core i2c_i801 shpchp snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc ext4 jbd2 mbcache sd_mod crc_t10dif ahci xhci_hcd i915 drm_kms_helper drm i2c_algo_bit i2c_core video output dm_mirror dm_region_hash dm_log dm_mod [last unloaded: scsi_wait_scan]
Pid: 3725, comm: fh130demo Not tainted 2.6.32-504.el6.x86_64 #1
Call Trace:
[] ? warn_slowpath_common+0x87/0xc0
[] ? warn_slowpath_null+0x1a/0x20
[] ? __alloc_pages_nodemask+0x7a8/0x8d0
[] ? atomic_notifier_call_chain+0x1a/0x20
[] ? notify_update+0x2e/0x30
[] ? vt_console_print+0x260/0x330
[] ? up+0x2f/0x50
[] ? _call_console_drivers+0x4a/0x80
[] ? dma_generic_alloc_coherent+0xa6/0x160
[] ? apic_timer_interrupt+0xe/0x20
[] ? x86_swiotlb_alloc_coherent+0x31/0x70
[] ? dma_pool_alloc+0xfc/0x2a0
[] ? printk+0x41/0x44
[] ? hbaDevAllocDmaBuffers+0x2f6/0x8f0 [fh130drv]
[] ? hbaDevInitialize+0x168/0x1b0 [fh130drv]
[] ? Hba_FC_ASM_LoadConfig+0x54/0xa0 [fh130drv]
[] ? hba_dev_ioctl+0x1e2/0xbd0 [fh130drv]
[] ? avc_has_perm+0x71/0x90
[] ? pty_write+0x73/0x80
[] ? inode_has_perm+0x54/0xa0
[] ? remove_wait_queue+0x3c/0x50
[] ? __wake_up+0x53/0x70
[] ? vfs_ioctl+0x22/0xa0
[] ? do_vfs_ioctl+0x84/0x580
[] ? sys_ioctl+0x81/0xa0
[] ? __audit_syscall_exit+0x25e/0x290
[] ? system_call_fastpath+0x16/0x1b
---[ end trace 03df1cd6b697aafa ]---
求高手解答这个是怎么回事?
然后我想问一下,我可以分配
512 * 64*1024+1024这么大的DMA内存吗?并且对齐方式是64*1024?
然后我alloc的时候,每一块是多大呢?
谢谢了,没有金币了,不好意思!