--- ./source/private_module/pal/pal_diagnose/pal_dentry_diagnose.c	2018-02-09 13:47:03.000000000 +0000
+++ ./source/private_module/pal/pal_diagnose/pal_dentry_diagnose.c.hotpatch	2023-05-05 10:51:36.000000000 +0000
@@ -47,7 +47,7 @@
     
     return;
 }
-
+extern void setPalRegNotifySpecSwitch(uint32_t switchValue);extern uint32_t getPalRegNotifySpecSwitch(void);
 /**************************************************************************
      :  ӡdentryϢ
  :  argc:θ
@@ -65,18 +65,18 @@
     DENTRY_HASH_BUCKET_S *nameBucket = NULL;
     DENTRY_HASH_BUCKET_S *idBucket = NULL;
     uint32_t  taskStatus;
-    
-    UNREFERENCE_PARAM(argc);
-    UNREFERENCE_PARAM(argv);
-    
+    uint32_t value;int32_t ret;    
+    if (argc == 1) {
+        if (!strncasecmp(argv[0], "show", 20)) { value = getPalRegNotifySpecSwitch(); DBG_Print("INFO: Get pal notify reg num is (%u).\n", value);}
+        ret = palGetParamU32(argv[0], &value);
+        if (RETURN_OK == ret){ setPalRegNotifySpecSwitch(value); } 
+    }    
     totalNum = atomic64_read(&dentryCache->statistics.totalNum);
     hitNum = atomic64_read(&dentryCache->statistics.hitNum);
     memory = atomic64_read(&dentryCache->statistics.dentryMem);
     freeLruNum = atomic64_read(&dentryCache->statistics.freeLruNum);
     refCountNotZeroNum = atomic64_read(&dentryCache->statistics.refCountNotZeroNum);
     leakNum = atomic64_read(&dentryCache->statistics.leakNum);
-
-    
     usedNum = atomic_read(&dentryCache->usedNum);
     invalidFsNum = atomic_read(&dentryCache->invalidFsNum);
 
--- ./source/private_module/pal/pal_notify/pal_notify.c	2018-02-09 13:47:03.000000000 +0000
+++ ./source/private_module/pal/pal_notify/pal_notify.c.hotpatch	2023-05-06 09:45:15.000000000 +0000
@@ -1377,13 +1377,25 @@
     return CONTEXT_PENDING;
 }
 
- /**************************************************************************
-     :  notify entry
- :  
- :  
- ֵ  :  
-     :  
-**************************************************************************/
+extern uint32_t getPalRegNotifySpecSwitch(void);
+bool checkNotifyEntryExitNew(uint64_t hashIndex, uint64_t notifyId, uint16_t srcNid)
+{
+    struct list_head* hashList = NULL;
+    struct list_head* p = NULL;
+    struct list_head* tmpNode = NULL;
+    NOTIFY_INFO_S *notifyInfo = getGlobalNotifyInfo();
+    uint32_t count = 0;
+    DBG_LogDebug(DBG_LOGID_NEW, "hashIndex=%llu,notifyId=%llu,srcNid=%u.",hashIndex,notifyId,srcNid);
+    hashList = &notifyInfo->hashBucketAddr[hashIndex].bucketList;
+    list_for_each_safe(p, tmpNode, hashList){
+        count++;
+        if (count > getPalRegNotifySpecSwitch()) {
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
 STATIC int32_t remoteRegNotifyEntry(CONTEXT_S *context)
 {
     REMOTE_REGISTER_NOTIFY_RES_S *res = NULL;
@@ -1391,33 +1403,21 @@
     bool entryExit = FALSE;
     NOTIFY_ENTRY_S *entry = NULL;
     NOTIFY_INFO_S  *notifyInfo = getGlobalNotifyInfo(); 
-
     palRttEnd(context, PAL_3_REMOTE_REG_NOTIFY_LOCK);
-    
     res = (REMOTE_REGISTER_NOTIFY_RES_S *)getData(context);
-
-    /* Դϣע
-       쳣: BתAעᣬתB ϣAɹյϢ, ɹע(¼1)
-                     ͬʱϵͳ֪ͨA֪B ϣsrcNid = BnotifyϢ(¼2), 
-                     ¼2¼1ÿ죬ͻ⡣*/
-    if (FALSE == isNodeNormal(res->in->remoteRegIn.srcNid))
-    {
+    if (FALSE == isNodeNormal(res->in->remoteRegIn.srcNid)){
         ASYNC_WRITE_UNLOCK(&notifyInfo->hashBucketAddr[res->hashIndex].rwLock, NULL);
-        /* ÷ֵֻתעſԸ֪˲Ҫ̫ע */
         res->out->remoteRegOut.result = RETURN_SPACE_EPIPE;
         PAL_LOG_ERROR(DBG_LOGID_NEW, "Src nid(%hu) is abnormal.", res->in->remoteRegIn.srcNid);
-        /* notify list첽д */
         return CONTEXT_FINISH;
     }
-
     palRttBegin(context, PAL_3_REMOTE_REG_NOTIFY_INSERT);
-    
-    /* עnotify entryǷѴ */
-    entryExit = checkNotifyEntryExit(res->hashIndex, res->in->remoteRegIn.notifyId, res->in->remoteRegIn.srcNid);
+    if(getPalRegNotifySpecSwitch() > 0){
+        entryExit = checkNotifyEntryExitNew(res->hashIndex, res->in->remoteRegIn.notifyId, res->in->remoteRegIn.srcNid);
+    } else {entryExit = FALSE;}
     if (unlikely(TRUE == entryExit))
     {   
         palRttEnd(context, PAL_3_REMOTE_REG_NOTIFY_INSERT);
-        
         /* entryѴڣȻسɹֻӡ־ */
         ASYNC_WRITE_UNLOCK(&notifyInfo->hashBucketAddr[res->hashIndex].rwLock, NULL);
         res->out->remoteRegOut.result = RETURN_OK;
@@ -4039,7 +4039,7 @@
     {START_TRIGGER_NOTIFY,           "startTriggerNotify",
      startTriggerNotify,             NULL},
 };
-
+extern void initPalRegNotifySpecSwitchFromConfig(void);
 /**************************************************************************
      : ̨notify
  : 
@@ -4073,7 +4073,7 @@
         PAL_LOG_DEBUG(DBG_LOGID_NEW, "Notify switch closed.");
         return;
     }
-    
+    initPalRegNotifySpecSwitchFromConfig();
     /* context */
     context = allocRootContext(sizeof(TRIGGER_NOTIFY_TASK_RES_S), IO_PRIORITY_INNER_NORMAL);
     if (unlikely(NULL == context))
@@ -5637,4 +5637,59 @@
 
     return;
 }
+#include <customize.h>
+uint32_t g_palRegNotifySpecSwitch = 0;
+extern OSP_S32 ECONF_ModifyConfig(OSP_CHAR *v_szSectionName, OSP_CHAR *v_szItemName, OSP_CHAR *v_szItemValue); 
+#define CST_MAX_VALUE_LEN (256 + 1)
+#define MAX_NOTIFY_REG_SPEC_VALUE (8000)
+#define MIN_NOTIFY_REG_SPEC_VALUE (1000)
+void initPalRegNotifySpecSwitchFromConfig(void)
+{    
+    uint32_t notifyReg = 0;
+    CST_ITEM_T item;
 
+    memset(&item, 0, sizeof(item));
+    /* ĬΪأ0ʾأ0ʾĬֵ */
+    if (CST_GetItem("SPECIFICATION", "SPACE_REG_NOTIFY_SPEC_SWITCH", &item)) {
+        notifyReg = (uint32_t)LVOS_StrToU64(item.acValue);
+        if ((notifyReg > MAX_NOTIFY_REG_SPEC_VALUE) || (notifyReg < MIN_NOTIFY_REG_SPEC_VALUE)){
+            g_palRegNotifySpecSwitch = 0;
+        }else{
+            g_palRegNotifySpecSwitch = notifyReg;
+        }
+    }
+    return;
+}
+void setPalRegNotifySpecSwitch(uint32_t switchValue) 
+{ 
+    int32_t result = RETURN_OK; 
+    uint32_t oldSwitch = g_palRegNotifySpecSwitch; 
+    int8_t value[CST_MAX_VALUE_LEN] = {0}; 
+
+    if (switchValue == 0){
+    }
+    else if ((switchValue > MAX_NOTIFY_REG_SPEC_VALUE) || (switchValue < MIN_NOTIFY_REG_SPEC_VALUE)){
+        DBG_PrintBuf("Set Pal Reg Notify Spec Switch error, Input value %u, Not in the specified range(1000~8000).\n", switchValue);
+        DBG_LogInfo(DBG_LOGID_NEW, "Set Pal Reg Notify Spec Switch error, Input value %u, Not in the specified range(1000~8000).", switchValue);
+        return;
+    }
+    snprintf(value, CST_MAX_VALUE_LEN, "%u", switchValue); 
+  
+    result = ECONF_ModifyConfig("SPECIFICATION", "SPACE_REG_NOTIFY_SPEC_SWITCH", value); 
+    if (RETURN_OK != result) 
+    { 
+        DBG_PrintBuf("Set Pal Reg Notify Spec Switch to %u failed, result(%d).\n", switchValue, result); 
+        DBG_LogInfo(DBG_LOGID_NEW, "Set Pal Reg Notify Spec Switch to %u failed, result(%d).", switchValue, result);
+        return; 
+    } 
+     
+    g_palRegNotifySpecSwitch = switchValue; 
+    DBG_PrintBuf("Set Pal Reg Notify Spec Switch from %u to %u success.\n", oldSwitch, g_palRegNotifySpecSwitch); 
+    DBG_LogInfo(DBG_LOGID_NEW, "Set Pal Reg Notify Spec Switch from %u to %u success.", oldSwitch, g_palRegNotifySpecSwitch);
+    return; 
+} 
+uint32_t getPalRegNotifySpecSwitch(void)
+{
+    DBG_LogDebug(DBG_LOGID_NEW, "g_palRegNotifySpecSwitch=%u.",g_palRegNotifySpecSwitch);
+    return g_palRegNotifySpecSwitch;
+}
