With the development of the gigabit-Ethernet passive optical network (GEPON), the polling mechanism is widely used in allocating bandwidth of GEPON in order to solve the bottleneck problem of an access network. The polling mechanism is effective in GEPON bandwidth allocation. However, the mechanism has some problems of its own that are quite prominent and cannot be solved by the mechanism itself, such as the waste of time slot, waste of authorized window, waste of idle queue, and so on. This paper proposes a dynamic programmable scheduling mechanism that can effectively solve the problems of the polling mechanism. At the same time, the dynamic programmable scheduling mechanism can provide a greater degree of flexibility that enables service providers to decide, adjust, and achieve their own bandwidth allocation logic after the network is fixed. In addition, to a large extent, the proposed mechanism can promote interoperability among different GEPON systems.