add auto cpu core load balance for x86/x64

This commit is contained in:
coolsnowwolf 2017-09-21 23:37:20 +08:00
parent bcf2e98c23
commit 764450b7a1
5 changed files with 65 additions and 5 deletions

View File

@ -117,5 +117,5 @@ endef
$(eval $(call KernelPackage,shortcut-fe))
$(eval $(call KernelPackage,shortcut-fe-cm))
$(eval $(call KernelPackage,fast-classifier))
$(eval $(call BuildPackage,fast-classifier-example))
#$(eval $(call BuildPackage,fast-classifier-example))

View File

@ -0,0 +1,35 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_VERSION:=1
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
define Package/autocore
TITLE:=x86/x64 auto core loadbalance script.
MAINTAINER:=Lean
DEPENDS:=@TARGET_x86 +bc
endef
define Package/autocore/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/autocore/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/autocore $(1)/etc/init.d/autocore
endef
$(eval $(call BuildPackage,autocore))

View File

@ -0,0 +1,29 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2017 lean <coolsnowwolf@gmail.com>
START=99
start()
{
rfc=4096
cc=$(grep -c processor /proc/cpuinfo)
rsfe=$(echo $cc*$rfc | bc)
sysctl -w net.core.rps_sock_flow_entries=$rsfe
for fileRps in $(ls /sys/class/net/eth*/queues/rx-*/rps_cpus)
do
echo ff > $fileRps
done
for fileRfc in $(ls /sys/class/net/eth*/queues/rx-*/rps_flow_cnt)
do
echo $rfc > $fileRfc
done
for fileRps in $(ls /sys/class/net/eth*/queues/tx-*/xps_cpus)
do
echo ff > $fileRps
done
}

View File

@ -15,8 +15,6 @@ PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/automount
SECTION:=net
CATEGORY:=Network
TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +kmod-fs-exfat +ntfs-3g

View File

@ -15,8 +15,6 @@ PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/autosamba
SECTION:=net
CATEGORY:=Network
TITLE:=Samba autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+luci-app-samba