Hello, These patches have the feel of swinging a very larger hammer at a small problem. It's really only the power path structs and pnp structs which can not tolerate a page-fault. Given that non-paged pool is a somewhat limited system resource, we need to be careful about wholesale allocation from non-paged pool.
Initially I would suggest changing only those cases where PNP structs and power-down path structs are accessed. stan. ________________________________ From: Leonid Keller [mailto:[email protected]] Sent: Thursday, September 17, 2009 3:33 AM To: Smith, Stan Cc: ofw_list Subject: RE: [ofw][patch][ibal] use non-pageable memory to prevent possibleproblems on power down To be yet more safe, we can change other usings of PagedPool by NonPagedPool. What do you think ? (I have not included winverbs and winmad drivers, leaving that to Sean). Index: V:/svn/winib/trunk/core/complib/kernel/cl_pnp_po.c =================================================================== --- V:/svn/winib/trunk/core/complib/kernel/cl_pnp_po.c (revision 4835) +++ V:/svn/winib/trunk/core/complib/kernel/cl_pnp_po.c (revision 4836) @@ -1185,7 +1185,7 @@ alloc_size += (sizeof(PDEVICE_OBJECT) * p_old_rel->Count); /* Allocate the new relations structure. */ - p_rel = ExAllocatePoolWithTag( PagedPool, alloc_size, 'ralc' ); + p_rel = ExAllocatePoolWithTag( NonPagedPool, alloc_size, 'ralc' ); p_irp->IoStatus.Information = (ULONG_PTR)p_rel; if( !p_rel ) { Index: V:/svn/winib/trunk/core/complib/kernel/cl_memory_osd.c =================================================================== --- V:/svn/winib/trunk/core/complib/kernel/cl_memory_osd.c (revision 4835) +++ V:/svn/winib/trunk/core/complib/kernel/cl_memory_osd.c (revision 4836) @@ -41,7 +41,7 @@ if( pageable ) { CL_ASSERT( KeGetCurrentIrql() < DISPATCH_LEVEL ); - return( ExAllocatePoolWithTag( PagedPool, size, 'virp' ) ); + return( ExAllocatePoolWithTag( NonPagedPool, size, 'virp' ) ); } else { Index: V:/svn/winib/trunk/core/bus/kernel/bus_port_mgr.c =================================================================== --- V:/svn/winib/trunk/core/bus/kernel/bus_port_mgr.c (revision 4835) +++ V:/svn/winib/trunk/core/bus/kernel/bus_port_mgr.c (revision 4836) @@ -1599,7 +1599,7 @@ dev_id_size = p_ext->pdo.p_pdo_device_info->device_id_size; /* Device ID is "IBA\SID_<sid> where <sid> is the IO device Service ID. */ - p_string = ExAllocatePoolWithTag( PagedPool, dev_id_size, 'vedq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, dev_id_size, 'vedq' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1635,7 +1635,7 @@ dev_id_size = p_ext->pdo.p_pdo_device_info->hardware_id_size; - p_string = ExAllocatePoolWithTag( PagedPool, dev_id_size, 'ihqp' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, dev_id_size, 'ihqp' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1670,7 +1670,7 @@ dev_id_size = p_ext->pdo.p_pdo_device_info->compatible_id_size; - p_string = ExAllocatePoolWithTag( PagedPool, dev_id_size, 'ihqp' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, dev_id_size, 'ihqp' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1710,7 +1710,7 @@ } /* The instance ID is the port GUID. */ - p_string = ExAllocatePoolWithTag( PagedPool, sizeof(WCHAR) * 21, 'iuqp' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(WCHAR) * 21, 'iuqp' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1754,7 +1754,7 @@ } - p_string = ExAllocatePoolWithTag( PagedPool, p_ext->pdo.p_pdo_device_info->description_size, 'edqp' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, p_ext->pdo.p_pdo_device_info->description_size, 'edqp' ); if( !p_string ) { @@ -1822,7 +1822,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - p_string = ExAllocatePoolWithTag( PagedPool, size, 'olqp' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, size, 'olqp' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1875,7 +1875,7 @@ *p_action = IrpComplete; - p_bus_info = ExAllocatePoolWithTag( PagedPool, sizeof(PNP_BUS_INFORMATION), 'ibqp' ); + p_bus_info = ExAllocatePoolWithTag( NonPagedPool, sizeof(PNP_BUS_INFORMATION), 'ibqp' ); if( !p_bus_info ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, Index: V:/svn/winib/trunk/core/bus/kernel/bus_iou_mgr.c =================================================================== --- V:/svn/winib/trunk/core/bus/kernel/bus_iou_mgr.c (revision 4835) +++ V:/svn/winib/trunk/core/bus/kernel/bus_iou_mgr.c (revision 4836) @@ -1164,7 +1164,7 @@ } /* Device ID is "IBA\SID_<sid> where <sid> is the IPoIB Service ID. */ - p_string = ExAllocatePoolWithTag( PagedPool, IOU_DEV_ID_SIZE, 'didq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, IOU_DEV_ID_SIZE, 'didq' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1209,7 +1209,7 @@ return STATUS_NO_SUCH_DEVICE; } - p_string = ExAllocatePoolWithTag( PagedPool, IOU_HW_ID_SIZE, 'dihq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, IOU_HW_ID_SIZE, 'dihq' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1263,7 +1263,7 @@ UNUSED_PARAM( p_dev_obj ); - p_string = ExAllocatePoolWithTag( PagedPool, sizeof(IOU_COMPAT_ID), 'dicq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(IOU_COMPAT_ID), 'dicq' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1299,7 +1299,7 @@ } /* The instance ID is the port GUID. */ - p_string = ExAllocatePoolWithTag( PagedPool, sizeof(WCHAR) * 33, 'diuq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(WCHAR) * 33, 'diuq' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1345,7 +1345,7 @@ } /* The instance ID is the port GUID. */ - p_string = ExAllocatePoolWithTag( PagedPool, + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(WCHAR) * sizeof(p_ext->desc), 'sedq' ); if( !p_string ) @@ -1391,7 +1391,7 @@ return STATUS_NO_SUCH_DEVICE; } - p_string = ExAllocatePoolWithTag( PagedPool, IOU_LOCATION_SIZE, 'colq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, IOU_LOCATION_SIZE, 'colq' ); if( !p_string ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, @@ -1430,7 +1430,7 @@ *p_action = IrpComplete; - p_bus_info = ExAllocatePoolWithTag( PagedPool, sizeof(PNP_BUS_INFORMATION), 'subq' ); + p_bus_info = ExAllocatePoolWithTag( NonPagedPool, sizeof(PNP_BUS_INFORMATION), 'subq' ); if( !p_bus_info ) { BUS_TRACE_EXIT( BUS_DBG_ERROR, Index: V:/svn/winib/trunk/core/iou/kernel/iou_ioc_mgr.c =================================================================== --- V:/svn/winib/trunk/core/iou/kernel/iou_ioc_mgr.c (revision 4835) +++ V:/svn/winib/trunk/core/iou/kernel/iou_ioc_mgr.c (revision 4836) @@ -952,7 +952,7 @@ { dev_id_size = (p_ext->pdo.p_pdo_device_info)->device_id_size; - p_string = ExAllocatePoolWithTag( PagedPool, dev_id_size, 'didq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, dev_id_size, 'didq' ); if( !p_string ) { @@ -968,7 +968,7 @@ } else { - p_string = ExAllocatePoolWithTag( PagedPool, IOC_DEV_ID_SIZE, 'didq' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, IOC_DEV_ID_SIZE, 'didq' ); if( !p_string ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, @@ -1027,7 +1027,7 @@ { hw_id_size = p_ext->pdo.p_pdo_device_info->hardware_id_size; - p_string = ExAllocatePoolWithTag( PagedPool, hw_id_size, 'ihqi' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, hw_id_size, 'ihqi' ); if( !p_string ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, @@ -1042,7 +1042,7 @@ } else { - p_string = ExAllocatePoolWithTag( PagedPool, IOC_HW_ID_SIZE, 'ihqi' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, IOC_HW_ID_SIZE, 'ihqi' ); if( !p_string ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, @@ -1143,7 +1143,7 @@ compat_id_size = p_ext->pdo.p_pdo_device_info->compatible_id_size; - p_string = ExAllocatePoolWithTag( PagedPool, compat_id_size, 'icqi' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, compat_id_size, 'icqi' ); if( !p_string ) { @@ -1159,7 +1159,7 @@ } else { - p_string = ExAllocatePoolWithTag( PagedPool, IOC_COMPAT_ID_SIZE, 'icqi' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, IOC_COMPAT_ID_SIZE, 'icqi' ); if( !p_string ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, @@ -1229,7 +1229,7 @@ if ( p_ext->pdo.p_pdo_device_info ) { - p_string = ExAllocatePoolWithTag( PagedPool, sizeof(WCHAR) * 41, 'iuqi' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(WCHAR) * 41, 'iuqi' ); if( !p_string ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, @@ -1252,7 +1252,7 @@ } else { - p_string = ExAllocatePoolWithTag( PagedPool, sizeof(WCHAR) * 33, 'iuqi' ); + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(WCHAR) * 33, 'iuqi' ); if( !p_string ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, @@ -1302,7 +1302,7 @@ if ( p_ext->pdo.p_pdo_device_info ) { - p_string = ExAllocatePoolWithTag( PagedPool, p_ext->pdo.p_pdo_device_info->description_size, + p_string = ExAllocatePoolWithTag( NonPagedPool, p_ext->pdo.p_pdo_device_info->description_size, 'edqi' ); if( !p_string ) { @@ -1320,7 +1320,7 @@ } else { - p_string = ExAllocatePoolWithTag( PagedPool, + p_string = ExAllocatePoolWithTag( NonPagedPool, sizeof(WCHAR) * sizeof(p_ext->info.profile.id_string), 'edqi'); if( !p_string ) @@ -1387,7 +1387,7 @@ return STATUS_NO_SUCH_DEVICE; } - p_string = ExAllocatePoolWithTag( PagedPool, + p_string = ExAllocatePoolWithTag( NonPagedPool, max( IOC_LOCATION_SIZE, sizeof( WCHAR ) * ( sizeof( p_ext->info.profile.id_string ) + 1 )), 'olqi'); @@ -1447,7 +1447,7 @@ *p_action = IrpComplete; - p_iou_info = ExAllocatePoolWithTag( PagedPool, sizeof(PNP_BUS_INFORMATION), 'ibqi' ); + p_iou_info = ExAllocatePoolWithTag( NonPagedPool, sizeof(PNP_BUS_INFORMATION), 'ibqi' ); if( !p_iou_info ) { IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, Index: V:/svn/winib/trunk/etc/kernel/index_list.c =================================================================== --- V:/svn/winib/trunk/etc/kernel/index_list.c (revision 4835) +++ V:/svn/winib/trunk/etc/kernel/index_list.c (revision 4836) @@ -37,7 +37,7 @@ SIZE_T size, i; size = pIndexList->Size + (PAGE_SIZE / sizeof(INDEX_ENTRY)); - array = ExAllocatePoolWithTag(PagedPool, size * sizeof(INDEX_ENTRY), 'xdni'); + array = ExAllocatePoolWithTag(NonPagedPool, size * sizeof(INDEX_ENTRY), 'xdni'); if (array == NULL) { return FALSE; } Index: V:/svn/winib/trunk/hw/mlx4/kernel/hca/drv.c =================================================================== --- V:/svn/winib/trunk/hw/mlx4/kernel/hca/drv.c (revision 4835) +++ V:/svn/winib/trunk/hw/mlx4/kernel/hca/drv.c (revision 4836) @@ -85,7 +85,7 @@ HCA_ENTER( HCA_DBG_PNP ); pIfc = - (ci_interface_t*)ExAllocatePoolWithTag( PagedPool, sizeof(ci_interface_t), MT_TAG_KERNEL ); + (ci_interface_t*)ExAllocatePoolWithTag( NonPagedPool, sizeof(ci_interface_t), MT_TAG_KERNEL ); if( !pIfc ) { HCA_PRINT( TRACE_LEVEL_ERROR,HCA_DBG_PNP, @@ -877,7 +877,7 @@ HCA_ENTER( HCA_DBG_PNP ); - pIfc = (ci_interface_t*)ExAllocatePoolWithTag( PagedPool, + pIfc = (ci_interface_t*)ExAllocatePoolWithTag( NonPagedPool, sizeof(ci_interface_t), MT_TAG_KERNEL ); if( !pIfc ) { Index: V:/svn/winib/trunk/hw/mthca/kernel/hca_pnp.c =================================================================== --- V:/svn/winib/trunk/hw/mthca/kernel/hca_pnp.c (revision 4835) +++ V:/svn/winib/trunk/hw/mthca/kernel/hca_pnp.c (revision 4836) @@ -227,7 +227,7 @@ HCA_ENTER( HCA_DBG_PNP ); - pIfc = (ci_interface_t*)ExAllocatePoolWithTag( PagedPool, + pIfc = (ci_interface_t*)ExAllocatePoolWithTag( NonPagedPool, sizeof(ci_interface_t), 'pnpa' ); if( !pIfc ) ________________________________ From: Smith, Stan [mailto:[email protected]] Sent: Wednesday, September 16, 2009 7:01 PM To: Leonid Keller Cc: ofw_list Subject: RE: [ofw][patch][ibal] use non-pageable memory to prevent possibleproblems on power down Hello, This patch appears to have cured the sometimes BSOD on power-down. After 53 uninstalls I have yet to witness a BSOD!! There was a similar patch to winverbs (paged vs. non-paged PNP struct allocation) which also cured a power-down BSOD, so it's not too surprising this patch has the same effect. I will be including it in the WinOF 2.1 release (upcoming RC5). stan. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Leonid Keller Sent: Tuesday, September 15, 2009 1:15 AM To: ofw_list Subject: [ofw][patch][ibal] use non-pageable memory to prevent possible problems on power down IBAL uses pageable memory to create PnP context. It can create possible problems in power down flows at the time of system contention. We saw some similar case at a customer. There is no strong evidence that that is what influenced, but with this patch IBAL will be more safe and at no cost. Found by Hobin Lee (Xsigo). Index: kernel/al_pnp.c =================================================================== --- kernel/al_pnp.c (revision 2421) +++ kernel/al_pnp.c (working copy) @@ -587,7 +587,7 @@ CL_ASSERT( p_reg ); /* No context exists for this port. Create one. */ - p_context = (al_pnp_context_t*)cl_pzalloc( sizeof(al_pnp_context_t) ); + p_context = (al_pnp_context_t*)cl_zalloc( sizeof(al_pnp_context_t) ); if( !p_context ) { AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
_______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
